From 43a25d93ebdabea52f99b05e15b06250cd8f07d7 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 17 May 2023 16:05:49 +0000 Subject: Add latest changes from gitlab-org/gitlab@16-0-stable-ee --- .../backfill_project_namespace_details_spec.rb | 47 +++++++++++++--------- 1 file changed, 28 insertions(+), 19 deletions(-) (limited to 'spec/lib/gitlab/background_migration/backfill_project_namespace_details_spec.rb') diff --git a/spec/lib/gitlab/background_migration/backfill_project_namespace_details_spec.rb b/spec/lib/gitlab/background_migration/backfill_project_namespace_details_spec.rb index 01daf16d10c..aac17a426b5 100644 --- a/spec/lib/gitlab/background_migration/backfill_project_namespace_details_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_project_namespace_details_spec.rb @@ -8,32 +8,41 @@ RSpec.describe Gitlab::BackgroundMigration::BackfillProjectNamespaceDetails, :mi let!(:projects) { table(:projects) } subject(:perform_migration) do - described_class.new(start_id: projects.minimum(:id), - end_id: projects.maximum(:id), - batch_table: :projects, - batch_column: :id, - sub_batch_size: 2, - pause_ms: 0, - connection: ActiveRecord::Base.connection) - .perform + described_class.new( + start_id: projects.minimum(:id), + end_id: projects.maximum(:id), + batch_table: :projects, + batch_column: :id, + sub_batch_size: 2, + pause_ms: 0, + connection: ActiveRecord::Base.connection + ).perform end describe '#perform' do it 'creates details for all project namespaces in range' do - namespaces.create!(id: 5, name: 'test1', path: 'test1', description: "Some description1", - description_html: "Some description html1", cached_markdown_version: 4) + namespaces.create!( + id: 5, name: 'test1', path: 'test1', description: "Some description1", + description_html: "Some description html1", cached_markdown_version: 4 + ) project_namespace1 = namespaces.create!(id: 6, name: 'test2', path: 'test2', type: 'Project') - namespaces.create!(id: 7, name: 'test3', path: 'test3', description: "Some description3", - description_html: "Some description html3", cached_markdown_version: 4) + namespaces.create!( + id: 7, name: 'test3', path: 'test3', description: "Some description3", + description_html: "Some description html3", cached_markdown_version: 4 + ) project_namespace2 = namespaces.create!(id: 8, name: 'test4', path: 'test4', type: 'Project') - project1 = projects.create!(namespace_id: project_namespace1.id, name: 'gitlab1', path: 'gitlab1', - project_namespace_id: project_namespace1.id, description: "Some description2", - description_html: "Some description html2", cached_markdown_version: 4) - project2 = projects.create!(namespace_id: project_namespace2.id, name: 'gitlab2', path: 'gitlab2', - project_namespace_id: project_namespace2.id, - description: "Some description3", - description_html: "Some description html4", cached_markdown_version: 4) + project1 = projects.create!( + namespace_id: project_namespace1.id, name: 'gitlab1', path: 'gitlab1', + project_namespace_id: project_namespace1.id, description: "Some description2", + description_html: "Some description html2", cached_markdown_version: 4 + ) + project2 = projects.create!( + namespace_id: project_namespace2.id, name: 'gitlab2', path: 'gitlab2', + project_namespace_id: project_namespace2.id, + description: "Some description3", + description_html: "Some description html4", cached_markdown_version: 4 + ) namespace_details.delete_all -- cgit v1.2.1