diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-01-06 14:44:43 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-01-06 14:44:43 +0100 |
commit | 2d2f9e51594e33f04bfda4012e3d4c7e48539fe3 (patch) | |
tree | dc74f56abcfe8b4ec00d86b4b6897f823f0e5bff /spec/lib | |
parent | 3c89252e53147fed0d134988a6ec29aa2c02abe5 (diff) | |
download | gitlab-ce-2d2f9e51594e33f04bfda4012e3d4c7e48539fe3.tar.gz |
Do not attempt to migrate legacy pipeline stages
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/background_migration/migrate_build_stage_spec.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/lib/gitlab/background_migration/migrate_build_stage_spec.rb b/spec/lib/gitlab/background_migration/migrate_build_stage_spec.rb index b675db463af..d20b5c29a71 100644 --- a/spec/lib/gitlab/background_migration/migrate_build_stage_spec.rb +++ b/spec/lib/gitlab/background_migration/migrate_build_stage_spec.rb @@ -29,6 +29,8 @@ describe Gitlab::BackgroundMigration::MigrateBuildStage, :migration, schema: 201 stage_idx: 1, stage: 'test', status: :success) jobs.create!(id: 5, commit_id: 1, project_id: 123, stage_idx: 3, stage: 'deploy', status: :pending) + jobs.create!(id: 6, commit_id: 1, project_id: 123, + stage_idx: 3, stage: nil, status: :pending) end it 'correctly migrates builds stages' do @@ -40,7 +42,8 @@ describe Gitlab::BackgroundMigration::MigrateBuildStage, :migration, schema: 201 expect(stages.count).to eq 3 expect(stages.all.pluck(:name)).to match_array %w[test build deploy] - expect(jobs.where(stage_id: nil)).to be_empty + expect(jobs.where(stage_id: nil)).to be_one + expect(jobs.find_by(stage_id: nil).id).to eq 6 expect(stages.all.pluck(:status)).to match_array [STATUSES[:success], STATUSES[:failed], STATUSES[:pending]] |