Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/github_import')
-rw-r--r--spec/lib/gitlab/github_import/importer/diff_note_importer_spec.rb12
-rw-r--r--spec/lib/gitlab/github_import/importer/pull_requests_reviews_importer_spec.rb4
-rw-r--r--spec/lib/gitlab/github_import/importer/single_endpoint_diff_notes_importer_spec.rb4
-rw-r--r--spec/lib/gitlab/github_import/importer/single_endpoint_issue_notes_importer_spec.rb4
-rw-r--r--spec/lib/gitlab/github_import/importer/single_endpoint_merge_request_notes_importer_spec.rb4
-rw-r--r--spec/lib/gitlab/github_import/milestone_finder_spec.rb2
-rw-r--r--spec/lib/gitlab/github_import/parallel_scheduling_spec.rb71
7 files changed, 48 insertions, 53 deletions
diff --git a/spec/lib/gitlab/github_import/importer/diff_note_importer_spec.rb b/spec/lib/gitlab/github_import/importer/diff_note_importer_spec.rb
index 321ad7d3238..8eeb2332131 100644
--- a/spec/lib/gitlab/github_import/importer/diff_note_importer_spec.rb
+++ b/spec/lib/gitlab/github_import/importer/diff_note_importer_spec.rb
@@ -181,8 +181,10 @@ RSpec.describe Gitlab::GithubImport::Importer::DiffNoteImporter, :aggregate_fail
expect(Gitlab::GithubImport::Logger)
.to receive(:warn)
.with(
- message: "Validation failed: Line code can't be blank, Line code must be a valid line code, Position is incomplete",
- 'error.class': 'Gitlab::GithubImport::Importer::DiffNoteImporter::DiffNoteCreationError'
+ {
+ message: "Validation failed: Line code can't be blank, Line code must be a valid line code, Position is incomplete",
+ 'error.class': 'Gitlab::GithubImport::Importer::DiffNoteImporter::DiffNoteCreationError'
+ }
)
expect { subject.execute }
@@ -204,8 +206,10 @@ RSpec.describe Gitlab::GithubImport::Importer::DiffNoteImporter, :aggregate_fail
expect(Gitlab::GithubImport::Logger)
.to receive(:warn)
.with(
- message: 'Failed to create diff note file',
- 'error.class': 'DiffNote::NoteDiffFileCreationError'
+ {
+ message: 'Failed to create diff note file',
+ 'error.class': 'DiffNote::NoteDiffFileCreationError'
+ }
)
expect { subject.execute }
diff --git a/spec/lib/gitlab/github_import/importer/pull_requests_reviews_importer_spec.rb b/spec/lib/gitlab/github_import/importer/pull_requests_reviews_importer_spec.rb
index c5fa67e50aa..0eb86feb040 100644
--- a/spec/lib/gitlab/github_import/importer/pull_requests_reviews_importer_spec.rb
+++ b/spec/lib/gitlab/github_import/importer/pull_requests_reviews_importer_spec.rb
@@ -48,7 +48,7 @@ RSpec.describe Gitlab::GithubImport::Importer::PullRequestsReviewsImporter do
expect(client)
.to receive(:each_page)
.exactly(:once) # ensure to be cached on the second call
- .with(:pull_request_reviews, 'github/repo', merge_request.iid, page: 1)
+ .with(:pull_request_reviews, 'github/repo', merge_request.iid, { page: 1 })
.and_yield(page)
expect { |b| subject.each_object_to_import(&b) }
@@ -67,7 +67,7 @@ RSpec.describe Gitlab::GithubImport::Importer::PullRequestsReviewsImporter do
expect(client)
.to receive(:each_page)
.exactly(:once) # ensure to be cached on the second call
- .with(:pull_request_reviews, 'github/repo', merge_request.iid, page: 2)
+ .with(:pull_request_reviews, 'github/repo', merge_request.iid, { page: 2 })
subject.each_object_to_import {}
end
diff --git a/spec/lib/gitlab/github_import/importer/single_endpoint_diff_notes_importer_spec.rb b/spec/lib/gitlab/github_import/importer/single_endpoint_diff_notes_importer_spec.rb
index 8c71d7d0ed7..471302cb31b 100644
--- a/spec/lib/gitlab/github_import/importer/single_endpoint_diff_notes_importer_spec.rb
+++ b/spec/lib/gitlab/github_import/importer/single_endpoint_diff_notes_importer_spec.rb
@@ -33,7 +33,7 @@ RSpec.describe Gitlab::GithubImport::Importer::SingleEndpointDiffNotesImporter d
expect(client)
.to receive(:each_page)
.exactly(:once) # ensure to be cached on the second call
- .with(:pull_request_comments, 'github/repo', merge_request.iid, page: 1)
+ .with(:pull_request_comments, 'github/repo', merge_request.iid, { page: 1 })
.and_yield(page)
expect { |b| subject.each_object_to_import(&b) }.to yield_with_args(note)
@@ -56,7 +56,7 @@ RSpec.describe Gitlab::GithubImport::Importer::SingleEndpointDiffNotesImporter d
expect(client)
.to receive(:each_page)
.exactly(:once) # ensure to be cached on the second call
- .with(:pull_request_comments, 'github/repo', merge_request.iid, page: 2)
+ .with(:pull_request_comments, 'github/repo', merge_request.iid, { page: 2 })
subject.each_object_to_import {}
end
diff --git a/spec/lib/gitlab/github_import/importer/single_endpoint_issue_notes_importer_spec.rb b/spec/lib/gitlab/github_import/importer/single_endpoint_issue_notes_importer_spec.rb
index 8d8f2730880..d769f4fdcf5 100644
--- a/spec/lib/gitlab/github_import/importer/single_endpoint_issue_notes_importer_spec.rb
+++ b/spec/lib/gitlab/github_import/importer/single_endpoint_issue_notes_importer_spec.rb
@@ -32,7 +32,7 @@ RSpec.describe Gitlab::GithubImport::Importer::SingleEndpointIssueNotesImporter
expect(client)
.to receive(:each_page)
.exactly(:once) # ensure to be cached on the second call
- .with(:issue_comments, 'github/repo', issue.iid, page: 1)
+ .with(:issue_comments, 'github/repo', issue.iid, { page: 1 })
.and_yield(page)
expect { |b| subject.each_object_to_import(&b) }.to yield_with_args(note)
@@ -55,7 +55,7 @@ RSpec.describe Gitlab::GithubImport::Importer::SingleEndpointIssueNotesImporter
expect(client)
.to receive(:each_page)
.exactly(:once) # ensure to be cached on the second call
- .with(:issue_comments, 'github/repo', issue.iid, page: 2)
+ .with(:issue_comments, 'github/repo', issue.iid, { page: 2 })
subject.each_object_to_import {}
end
diff --git a/spec/lib/gitlab/github_import/importer/single_endpoint_merge_request_notes_importer_spec.rb b/spec/lib/gitlab/github_import/importer/single_endpoint_merge_request_notes_importer_spec.rb
index b8282212a90..1dcc466d34c 100644
--- a/spec/lib/gitlab/github_import/importer/single_endpoint_merge_request_notes_importer_spec.rb
+++ b/spec/lib/gitlab/github_import/importer/single_endpoint_merge_request_notes_importer_spec.rb
@@ -33,7 +33,7 @@ RSpec.describe Gitlab::GithubImport::Importer::SingleEndpointMergeRequestNotesIm
expect(client)
.to receive(:each_page)
.exactly(:once) # ensure to be cached on the second call
- .with(:issue_comments, 'github/repo', merge_request.iid, page: 1)
+ .with(:issue_comments, 'github/repo', merge_request.iid, { page: 1 })
.and_yield(page)
expect { |b| subject.each_object_to_import(&b) }.to yield_with_args(note)
@@ -56,7 +56,7 @@ RSpec.describe Gitlab::GithubImport::Importer::SingleEndpointMergeRequestNotesIm
expect(client)
.to receive(:each_page)
.exactly(:once) # ensure to be cached on the second call
- .with(:issue_comments, 'github/repo', merge_request.iid, page: 2)
+ .with(:issue_comments, 'github/repo', merge_request.iid, { page: 2 })
subject.each_object_to_import {}
end
diff --git a/spec/lib/gitlab/github_import/milestone_finder_spec.rb b/spec/lib/gitlab/github_import/milestone_finder_spec.rb
index fe8652eb5a2..e7f47d334e8 100644
--- a/spec/lib/gitlab/github_import/milestone_finder_spec.rb
+++ b/spec/lib/gitlab/github_import/milestone_finder_spec.rb
@@ -44,7 +44,7 @@ RSpec.describe Gitlab::GithubImport::MilestoneFinder, :clean_gitlab_redis_cache
it 'builds the cache of all project milestones' do
expect(Gitlab::Cache::Import::Caching)
.to receive(:write_multiple)
- .with("github-import/milestone-finder/#{project.id}/1" => milestone.id)
+ .with({ "github-import/milestone-finder/#{project.id}/1" => milestone.id })
.and_call_original
finder.build_cache
diff --git a/spec/lib/gitlab/github_import/parallel_scheduling_spec.rb b/spec/lib/gitlab/github_import/parallel_scheduling_spec.rb
index 200898f8f03..999f8ffb21e 100644
--- a/spec/lib/gitlab/github_import/parallel_scheduling_spec.rb
+++ b/spec/lib/gitlab/github_import/parallel_scheduling_spec.rb
@@ -87,19 +87,23 @@ RSpec.describe Gitlab::GithubImport::ParallelScheduling do
expect(Gitlab::GithubImport::Logger)
.to receive(:info)
.with(
- message: 'starting importer',
- parallel: false,
- project_id: project.id,
- importer: 'Class'
+ {
+ message: 'starting importer',
+ parallel: false,
+ project_id: project.id,
+ importer: 'Class'
+ }
)
expect(Gitlab::GithubImport::Logger)
.to receive(:info)
.with(
- message: 'importer finished',
- parallel: false,
- project_id: project.id,
- importer: 'Class'
+ {
+ message: 'importer finished',
+ parallel: false,
+ project_id: project.id,
+ importer: 'Class'
+ }
)
importer.execute
@@ -118,20 +122,24 @@ RSpec.describe Gitlab::GithubImport::ParallelScheduling do
expect(Gitlab::GithubImport::Logger)
.to receive(:info)
.with(
- message: 'starting importer',
- parallel: false,
- project_id: project.id,
- importer: 'Class'
+ {
+ message: 'starting importer',
+ parallel: false,
+ project_id: project.id,
+ importer: 'Class'
+ }
)
expect(Gitlab::Import::ImportFailureService)
.to receive(:track)
.with(
- project_id: project.id,
- exception: exception,
- error_source: 'MyImporter',
- fail_import: false,
- metrics: true
+ {
+ project_id: project.id,
+ exception: exception,
+ error_source: 'MyImporter',
+ fail_import: false,
+ metrics: true
+ }
).and_call_original
expect { importer.execute }
@@ -184,10 +192,12 @@ RSpec.describe Gitlab::GithubImport::ParallelScheduling do
expect(Gitlab::GithubImport::Logger)
.to receive(:info)
.with(
- message: 'starting importer',
- parallel: false,
- project_id: project.id,
- importer: 'Class'
+ {
+ message: 'starting importer',
+ parallel: false,
+ project_id: project.id,
+ importer: 'Class'
+ }
)
expect(Gitlab::Import::ImportFailureService)
@@ -290,25 +300,6 @@ RSpec.describe Gitlab::GithubImport::ParallelScheduling do
importer.parallel_import
end
end
-
- context 'when distribute_github_parallel_import feature flag is disabled' do
- before do
- stub_feature_flags(distribute_github_parallel_import: false)
- end
-
- it 'imports data in parallel' do
- expect(importer)
- .to receive(:each_object_to_import)
- .and_yield(object)
-
- expect(worker_class)
- .to receive(:perform_async)
- .with(project.id, { title: 'Foo' }, an_instance_of(String))
-
- expect(importer.parallel_import)
- .to be_an_instance_of(Gitlab::JobWaiter)
- end
- end
end
describe '#each_object_to_import' do