summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-06-28 11:29:04 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-06-28 11:29:04 +0200
commitb21ee2ee36e1aaddbe0b3541a8cac5f117143b66 (patch)
treef6d732ae94b075b988e2f91e3e046cd88c8812b3 /spec
parent18a7fa550d2ab9ab4c20709a9fa0a0a75e3bf3c6 (diff)
downloadgitlab-ce-b21ee2ee36e1aaddbe0b3541a8cac5f117143b66.tar.gz
Add initial stage_id background migration files
Diffstat (limited to 'spec')
-rw-r--r--spec/migrations/migrate_stage_id_reference_in_background_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/migrations/migrate_stage_id_reference_in_background_spec.rb b/spec/migrations/migrate_stage_id_reference_in_background_spec.rb
new file mode 100644
index 00000000000..f86ef834afa
--- /dev/null
+++ b/spec/migrations/migrate_stage_id_reference_in_background_spec.rb
@@ -0,0 +1,26 @@
+require 'spec_helper'
+require Rails.root.join('db', 'post_migrate', '20170628080858_migrate_stage_id_reference_in_background')
+
+describe MigrateStageIdReferenceInBackground, :migration, :redis do
+ let(:jobs) { table(:ci_builds) }
+ let(:stages) { table(:ci_stages) }
+ let(:pipelines) { table(:ci_pipelines) }
+ let(:projects) { table(:projects) }
+
+ before do
+ projects.create!(id: 123, name: 'gitlab1', path: 'gitlab1')
+ pipelines.create!(id: 1, project_id: 123, ref: 'master', sha: 'adf43c3a')
+
+ jobs.create!(id: 1, commit_id: 1, project_id: 123, stage_idx: 2, stage: 'build')
+ jobs.create!(id: 2, commit_id: 1, project_id: 123, stage_idx: 2, stage: 'build')
+ jobs.create!(id: 3, commit_id: 1, project_id: 123, stage_idx: 1, stage: 'test')
+ jobs.create!(id: 4, commit_id: 1, project_id: 123, stage_idx: 3, stage: 'deploy')
+
+ stages.create(id: 101, pipeline_id: 1, project_id: 123, name: 'test')
+ stages.create(id: 102, pipeline_id: 1, project_id: 123, name: 'build')
+ stages.create(id: 103, pipeline_id: 1, project_id: 123, name: 'deploy')
+ end
+
+ it 'schedules background migrations' do
+ end
+end