summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-02-14 13:59:16 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-02-14 13:59:16 +0100
commit378b2bad11b893fabebc083d000295c1ec499b23 (patch)
treed28bcff9102930203b092a6ca9b9581882dcf849 /spec
parent8488c98e70561c6d7dde025131c15df4692b20b1 (diff)
downloadgitlab-ce-378b2bad11b893fabebc083d000295c1ec499b23.tar.gz
Migrate pipeline stages in batches instead of single row
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/background_migration/migrate_build_stage_spec.rb12
1 files changed, 2 insertions, 10 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 d20b5c29a71..27cb63848de 100644
--- a/spec/lib/gitlab/background_migration/migrate_build_stage_spec.rb
+++ b/spec/lib/gitlab/background_migration/migrate_build_stage_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-describe Gitlab::BackgroundMigration::MigrateBuildStage, :migration, schema: 20180105101928 do
+describe Gitlab::BackgroundMigration::MigrateBuildStage, :migration, schema: 20180212101928 do
let(:projects) { table(:projects) }
let(:pipelines) { table(:ci_pipelines) }
let(:stages) { table(:ci_stages) }
@@ -10,15 +10,9 @@ describe Gitlab::BackgroundMigration::MigrateBuildStage, :migration, schema: 201
failed: 4, canceled: 5, skipped: 6, manual: 7 }.freeze
before do
- ##
- # Dependencies
- #
projects.create!(id: 123, name: 'gitlab', path: 'gitlab-ce')
pipelines.create!(id: 1, project_id: 123, ref: 'master', sha: 'adf43c3a')
- ##
- # CI/CD jobs
- #
jobs.create!(id: 1, commit_id: 1, project_id: 123,
stage_idx: 2, stage: 'build', status: :success)
jobs.create!(id: 2, commit_id: 1, project_id: 123,
@@ -36,9 +30,7 @@ describe Gitlab::BackgroundMigration::MigrateBuildStage, :migration, schema: 201
it 'correctly migrates builds stages' do
expect(stages.count).to be_zero
- jobs.all.find_each do |job|
- described_class.new.perform(job.id)
- end
+ described_class.new.perform(1, 6)
expect(stages.count).to eq 3
expect(stages.all.pluck(:name)).to match_array %w[test build deploy]