diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-09-18 13:47:46 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-09-18 13:47:46 +0200 |
commit | 73d31251af6e0574423990836e56350b8ffbea41 (patch) | |
tree | 833d13aeb803afb63774a5cdbb4ca5e5cece3f7a /spec | |
parent | 9106975d3caacdda43ed6c0387d741f6c0795d27 (diff) | |
download | gitlab-ce-73d31251af6e0574423990836e56350b8ffbea41.tar.gz |
Make sure all stages are migrated after a cleanupbackstage/gb/steal-stages-statuses-migration
Diffstat (limited to 'spec')
-rw-r--r-- | spec/migrations/clean_stages_statuses_migration_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/migrations/clean_stages_statuses_migration_spec.rb b/spec/migrations/clean_stages_statuses_migration_spec.rb index 822a188e67d..38705f8eaae 100644 --- a/spec/migrations/clean_stages_statuses_migration_spec.rb +++ b/spec/migrations/clean_stages_statuses_migration_spec.rb @@ -23,6 +23,7 @@ describe CleanStagesStatusesMigration, :migration, :sidekiq, :redis do end end end + context 'when there are no background migrations pending' do it 'does nothing' do Sidekiq::Testing.disable! do @@ -32,4 +33,19 @@ describe CleanStagesStatusesMigration, :migration, :sidekiq, :redis do end end end + + context 'when there are still unmigrated stages afterwards' do + let(:stages) { table('ci_stages') } + + before do + stages.create!(status: nil, name: 'build') + stages.create!(status: nil, name: 'test') + end + + it 'migrates statuses sequentially in batches' do + migrate! + + expect(migration).to have_received(:perform).once + end + end end |