diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 18:42:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 18:42:06 +0000 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /spec/lib/gitlab/background_migration/migrate_stage_index_spec.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) | |
download | gitlab-ce-6e4e1050d9dba2b7b2523fdd1768823ab85feef4.tar.gz |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'spec/lib/gitlab/background_migration/migrate_stage_index_spec.rb')
-rw-r--r-- | spec/lib/gitlab/background_migration/migrate_stage_index_spec.rb | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/spec/lib/gitlab/background_migration/migrate_stage_index_spec.rb b/spec/lib/gitlab/background_migration/migrate_stage_index_spec.rb deleted file mode 100644 index 81874ff7982..00000000000 --- a/spec/lib/gitlab/background_migration/migrate_stage_index_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Gitlab::BackgroundMigration::MigrateStageIndex do - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - let(:pipelines) { table(:ci_pipelines) } - let(:stages) { table(:ci_stages) } - let(:jobs) { table(:ci_builds) } - let(:namespace) { namespaces.create(name: 'gitlab-org', path: 'gitlab-org') } - let(:project) { projects.create!(namespace_id: namespace.id, name: 'gitlab', path: 'gitlab') } - let(:pipeline) { pipelines.create!(project_id: project.id, ref: 'master', sha: 'adf43c3a') } - let(:stage1) { stages.create(project_id: project.id, pipeline_id: pipeline.id, name: 'build') } - let(:stage2) { stages.create(project_id: project.id, pipeline_id: pipeline.id, name: 'test') } - - before do - jobs.create!(commit_id: pipeline.id, project_id: project.id, - stage_idx: 2, stage_id: stage1.id) - jobs.create!(commit_id: pipeline.id, project_id: project.id, - stage_idx: 2, stage_id: stage1.id) - jobs.create!(commit_id: pipeline.id, project_id: project.id, - stage_idx: 10, stage_id: stage1.id) - jobs.create!(commit_id: pipeline.id, project_id: project.id, - stage_idx: 3, stage_id: stage2.id) - end - - it 'correctly migrates stages indices' do - expect(stages.all.pluck(:position)).to all(be_nil) - - described_class.new.perform(stage1.id, stage2.id) - - expect(stages.all.order(:id).pluck(:position)).to eq [2, 3] - end -end |