diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 12:26:25 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 12:26:25 +0000 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /spec/lib/gitlab/bitbucket_import | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) | |
download | gitlab-ce-a09983ae35713f5a2bbb100981116d31ce99826e.tar.gz |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'spec/lib/gitlab/bitbucket_import')
-rw-r--r-- | spec/lib/gitlab/bitbucket_import/importer_spec.rb | 26 | ||||
-rw-r--r-- | spec/lib/gitlab/bitbucket_import/project_creator_spec.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/bitbucket_import/wiki_formatter_spec.rb | 2 |
3 files changed, 17 insertions, 13 deletions
diff --git a/spec/lib/gitlab/bitbucket_import/importer_spec.rb b/spec/lib/gitlab/bitbucket_import/importer_spec.rb index 137d0fd4f9e..08b7bafddf0 100644 --- a/spec/lib/gitlab/bitbucket_import/importer_spec.rb +++ b/spec/lib/gitlab/bitbucket_import/importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::BitbucketImport::Importer do +RSpec.describe Gitlab::BitbucketImport::Importer do include ImportSpecHelper before do @@ -226,8 +226,8 @@ describe Gitlab::BitbucketImport::Importer do it 'counts imported pull requests' do expect(Gitlab::Metrics).to receive(:counter).with( - :bitbucket_importer_imported_pull_requests, - 'The number of imported Bitbucket pull requests' + :bitbucket_importer_imported_merge_requests_total, + 'The number of imported merge (pull) requests' ) expect(counter).to receive(:increment) @@ -369,8 +369,8 @@ describe Gitlab::BitbucketImport::Importer do it 'counts imported issues' do expect(Gitlab::Metrics).to receive(:counter).with( - :bitbucket_importer_imported_issues, - 'The number of imported Bitbucket issues' + :bitbucket_importer_imported_issues_total, + 'The number of imported issues' ) expect(counter).to receive(:increment) @@ -389,23 +389,27 @@ describe Gitlab::BitbucketImport::Importer do allow(subject).to receive(:import_issues) allow(subject).to receive(:import_pull_requests) - allow(Gitlab::Metrics).to receive(:counter) { counter } - allow(Gitlab::Metrics).to receive(:histogram) { histogram } + allow(Gitlab::Metrics).to receive(:counter).and_return(counter) + allow(Gitlab::Metrics).to receive(:histogram).and_return(histogram) + allow(histogram).to receive(:observe) + allow(counter).to receive(:increment) end it 'counts and measures duration of imported projects' do expect(Gitlab::Metrics).to receive(:counter).with( - :bitbucket_importer_imported_projects, - 'The number of imported Bitbucket projects' + :bitbucket_importer_imported_projects_total, + 'The number of imported projects' ) expect(Gitlab::Metrics).to receive(:histogram).with( :bitbucket_importer_total_duration_seconds, - 'Total time spent importing Bitbucket projects, in seconds' + 'Total time spent importing projects, in seconds', + {}, + Gitlab::Import::Metrics::IMPORT_DURATION_BUCKETS ) expect(counter).to receive(:increment) - expect(histogram).to receive(:observe).with({ importer: described_class::IMPORTER }, anything) + expect(histogram).to receive(:observe).with({ importer: :bitbucket_importer }, anything) subject.execute end diff --git a/spec/lib/gitlab/bitbucket_import/project_creator_spec.rb b/spec/lib/gitlab/bitbucket_import/project_creator_spec.rb index 0dd8547a925..236e04a041b 100644 --- a/spec/lib/gitlab/bitbucket_import/project_creator_spec.rb +++ b/spec/lib/gitlab/bitbucket_import/project_creator_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::BitbucketImport::ProjectCreator do +RSpec.describe Gitlab::BitbucketImport::ProjectCreator do let(:user) { create(:user) } let(:repo) do diff --git a/spec/lib/gitlab/bitbucket_import/wiki_formatter_spec.rb b/spec/lib/gitlab/bitbucket_import/wiki_formatter_spec.rb index 7b5c7847f2d..4c285d31979 100644 --- a/spec/lib/gitlab/bitbucket_import/wiki_formatter_spec.rb +++ b/spec/lib/gitlab/bitbucket_import/wiki_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::BitbucketImport::WikiFormatter do +RSpec.describe Gitlab::BitbucketImport::WikiFormatter do let(:project) do create(:project, namespace: create(:namespace, path: 'gitlabhq'), |