Commit 216b5c93 authored by Igor Drozdov's avatar Igor Drozdov

Skip running any approval migrations for FOSS

Any approval migrations contain the code that
exists only in EE version
That is why we need to skip the running for
the FOSS version
parent c83862e5
......@@ -22,6 +22,8 @@ class ScheduleProjectAnyApprovalRuleMigration < ActiveRecord::Migration[5.2]
end
def up
return unless Gitlab.ee?
add_concurrent_index :projects, :id,
name: 'tmp_projects_with_approvals_before_merge',
where: 'approvals_before_merge <> 0'
......
......@@ -22,6 +22,8 @@ class ScheduleMergeRequestAnyApprovalRuleMigration < ActiveRecord::Migration[5.2
end
def up
return unless Gitlab.ee?
add_concurrent_index :merge_requests, :id,
name: 'tmp_merge_requests_with_approvals_before_merge',
where: 'approvals_before_merge <> 0'
......
......@@ -48,4 +48,22 @@ describe ScheduleMergeRequestAnyApprovalRuleMigration, :migration, :sidekiq do
end
end
end
context 'for FOSS version' do
before do
allow(Gitlab).to receive(:ee?).and_return(false)
end
it 'does not schedule any jobs' do
create_merge_request(2)
Sidekiq::Testing.fake! do
Timecop.freeze do
migrate!
expect(BackgroundMigrationWorker.jobs.size).to eq(0)
end
end
end
end
end
......@@ -43,4 +43,22 @@ describe ScheduleProjectAnyApprovalRuleMigration, :migration, :sidekiq do
end
end
end
context 'for FOSS version' do
before do
allow(Gitlab).to receive(:ee?).and_return(false)
end
it 'does not schedule any jobs' do
create_project(2)
Sidekiq::Testing.fake! do
Timecop.freeze do
migrate!
expect(BackgroundMigrationWorker.jobs.size).to eq(0)
end
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment