diff options
Diffstat (limited to 'spec/workers/gitlab')
9 files changed, 12 insertions, 24 deletions
diff --git a/spec/workers/gitlab/github_import/import_diff_note_worker_spec.rb b/spec/workers/gitlab/github_import/import_diff_note_worker_spec.rb index 6476d82eb85..34073d0ea39 100644 --- a/spec/workers/gitlab/github_import/import_diff_note_worker_spec.rb +++ b/spec/workers/gitlab/github_import/import_diff_note_worker_spec.rb @@ -34,7 +34,7 @@ RSpec.describe Gitlab::GithubImport::ImportDiffNoteWorker do expect(importer) .to receive(:execute) - expect(worker.counter) + expect(Gitlab::GithubImport::ObjectCounter) .to receive(:increment) .and_call_original diff --git a/spec/workers/gitlab/github_import/import_issue_worker_spec.rb b/spec/workers/gitlab/github_import/import_issue_worker_spec.rb index 9f5bd1d9e5e..dc0338eccad 100644 --- a/spec/workers/gitlab/github_import/import_issue_worker_spec.rb +++ b/spec/workers/gitlab/github_import/import_issue_worker_spec.rb @@ -37,7 +37,7 @@ RSpec.describe Gitlab::GithubImport::ImportIssueWorker do expect(importer) .to receive(:execute) - expect(worker.counter) + expect(Gitlab::GithubImport::ObjectCounter) .to receive(:increment) .and_call_original diff --git a/spec/workers/gitlab/github_import/import_note_worker_spec.rb b/spec/workers/gitlab/github_import/import_note_worker_spec.rb index 94bc8e26e4a..bc254e6246d 100644 --- a/spec/workers/gitlab/github_import/import_note_worker_spec.rb +++ b/spec/workers/gitlab/github_import/import_note_worker_spec.rb @@ -32,7 +32,7 @@ RSpec.describe Gitlab::GithubImport::ImportNoteWorker do expect(importer) .to receive(:execute) - expect(worker.counter) + expect(Gitlab::GithubImport::ObjectCounter) .to receive(:increment) .and_call_original diff --git a/spec/workers/gitlab/github_import/import_pull_request_merged_by_worker_spec.rb b/spec/workers/gitlab/github_import/import_pull_request_merged_by_worker_spec.rb index c799c676300..728b4c6b440 100644 --- a/spec/workers/gitlab/github_import/import_pull_request_merged_by_worker_spec.rb +++ b/spec/workers/gitlab/github_import/import_pull_request_merged_by_worker_spec.rb @@ -12,12 +12,4 @@ RSpec.describe Gitlab::GithubImport::ImportPullRequestMergedByWorker do describe '#importer_class' do it { expect(subject.importer_class).to eq(Gitlab::GithubImport::Importer::PullRequestMergedByImporter) } end - - describe '#counter_name' do - it { expect(subject.counter_name).to eq(:github_importer_imported_pull_requests_merged_by) } - end - - describe '#counter_description' do - it { expect(subject.counter_description).to eq('The number of imported GitHub pull requests merged by') } - end end diff --git a/spec/workers/gitlab/github_import/import_pull_request_review_worker_spec.rb b/spec/workers/gitlab/github_import/import_pull_request_review_worker_spec.rb index cd14d6631d5..0607add52cd 100644 --- a/spec/workers/gitlab/github_import/import_pull_request_review_worker_spec.rb +++ b/spec/workers/gitlab/github_import/import_pull_request_review_worker_spec.rb @@ -12,12 +12,4 @@ RSpec.describe Gitlab::GithubImport::ImportPullRequestReviewWorker do describe '#importer_class' do it { expect(subject.importer_class).to eq(Gitlab::GithubImport::Importer::PullRequestReviewImporter) } end - - describe '#counter_name' do - it { expect(subject.counter_name).to eq(:github_importer_imported_pull_request_reviews) } - end - - describe '#counter_description' do - it { expect(subject.counter_description).to eq('The number of imported GitHub pull request reviews') } - end end diff --git a/spec/workers/gitlab/github_import/import_pull_request_worker_spec.rb b/spec/workers/gitlab/github_import/import_pull_request_worker_spec.rb index 1238929fbcb..6fe9741075f 100644 --- a/spec/workers/gitlab/github_import/import_pull_request_worker_spec.rb +++ b/spec/workers/gitlab/github_import/import_pull_request_worker_spec.rb @@ -43,7 +43,7 @@ RSpec.describe Gitlab::GithubImport::ImportPullRequestWorker do expect(importer) .to receive(:execute) - expect(worker.counter) + expect(Gitlab::GithubImport::ObjectCounter) .to receive(:increment) .and_call_original diff --git a/spec/workers/gitlab/github_import/stage/finish_import_worker_spec.rb b/spec/workers/gitlab/github_import/stage/finish_import_worker_spec.rb index 2615da2be15..8dea24dc74f 100644 --- a/spec/workers/gitlab/github_import/stage/finish_import_worker_spec.rb +++ b/spec/workers/gitlab/github_import/stage/finish_import_worker_spec.rb @@ -33,6 +33,10 @@ RSpec.describe Gitlab::GithubImport::Stage::FinishImportWorker do message: 'GitHub project import finished', import_stage: 'Gitlab::GithubImport::Stage::FinishImportWorker', import_source: :github, + object_counts: { + 'fetched' => {}, + 'imported' => {} + }, project_id: project.id, duration_s: a_kind_of(Numeric) ) diff --git a/spec/workers/gitlab/jira_import/stage/import_issues_worker_spec.rb b/spec/workers/gitlab/jira_import/stage/import_issues_worker_spec.rb index f82f6ccd9d6..10702c17cb5 100644 --- a/spec/workers/gitlab/jira_import/stage/import_issues_worker_spec.rb +++ b/spec/workers/gitlab/jira_import/stage/import_issues_worker_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Gitlab::JiraImport::Stage::ImportIssuesWorker do let_it_be(:jira_import, reload: true) { create(:jira_import_state, :scheduled, project: project) } before do - stub_jira_service_test + stub_jira_integration_test end context 'when import did not start' do @@ -25,7 +25,7 @@ RSpec.describe Gitlab::JiraImport::Stage::ImportIssuesWorker do end context 'when import started', :clean_gitlab_redis_cache do - let_it_be(:jira_service) { create(:jira_service, project: project) } + let_it_be(:jira_integration) { create(:jira_integration, project: project) } before do jira_import.start! diff --git a/spec/workers/gitlab/jira_import/stage/import_labels_worker_spec.rb b/spec/workers/gitlab/jira_import/stage/import_labels_worker_spec.rb index 0b7a35a92e2..52c516b9ff9 100644 --- a/spec/workers/gitlab/jira_import/stage/import_labels_worker_spec.rb +++ b/spec/workers/gitlab/jira_import/stage/import_labels_worker_spec.rb @@ -21,10 +21,10 @@ RSpec.describe Gitlab::JiraImport::Stage::ImportLabelsWorker do end context 'when import started' do - let!(:jira_service) { create(:jira_service, project: project) } + let!(:jira_integration) { create(:jira_integration, project: project) } before do - stub_jira_service_test + stub_jira_integration_test jira_import.start! |