diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-04-16 12:54:47 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-04-16 12:54:47 +0000 |
commit | c16619c527afdd00aa4dbbbf7544afb2f38477a8 (patch) | |
tree | 2d541ceff47cbd16a3a6ea72e0f5e65b0c7b633b /spec | |
parent | 29a53c4c31b8901f87818c86a9e8339334743616 (diff) | |
parent | 0cfa25ff21322d45aaef91fc7a3dd7c570632a05 (diff) | |
download | gitlab-ce-c16619c527afdd00aa4dbbbf7544afb2f38477a8.tar.gz |
Merge branch 'mc/feature/custom-metrics-ce' into 'master'
Backport metrics report type
See merge request gitlab-org/gitlab-ce!26798
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/ci/build_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/ci/pipeline_spec.rb | 24 | ||||
-rw-r--r-- | spec/services/ci/retry_build_service_spec.rb | 2 |
3 files changed, 25 insertions, 5 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 1352a2de2d7..66be192ab21 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -166,8 +166,8 @@ describe Ci::Build do end end - describe '.with_test_reports' do - subject { described_class.with_test_reports } + describe '.with_reports' do + subject { described_class.with_reports(Ci::JobArtifact.test_reports) } context 'when build has a test report' do let!(:build) { create(:ci_build, :success, :test_reports) } diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index 2b6b12650af..fd66e344d63 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -426,6 +426,26 @@ describe Ci::Pipeline, :mailer do end end + describe '.with_reports' do + subject { described_class.with_reports(Ci::JobArtifact.test_reports) } + + context 'when pipeline has a test report' do + let!(:pipeline_with_report) { create(:ci_pipeline, :with_test_reports) } + + it 'selects the pipeline' do + is_expected.to eq([pipeline_with_report]) + end + end + + context 'when pipeline does not have metrics reports' do + let!(:pipeline_without_report) { create(:ci_empty_pipeline) } + + it 'does not select the pipeline' do + is_expected.to be_empty + end + end + end + describe '.merge_request_event' do subject { described_class.merge_request_event } @@ -2729,8 +2749,8 @@ describe Ci::Pipeline, :mailer do end end - describe '#has_test_reports?' do - subject { pipeline.has_test_reports? } + describe '#has_reports?' do + subject { pipeline.has_reports?(Ci::JobArtifact.test_reports) } context 'when pipeline has builds with test reports' do before do diff --git a/spec/services/ci/retry_build_service_spec.rb b/spec/services/ci/retry_build_service_spec.rb index fc630b7098a..df2376384ca 100644 --- a/spec/services/ci/retry_build_service_spec.rb +++ b/spec/services/ci/retry_build_service_spec.rb @@ -30,7 +30,7 @@ describe Ci::RetryBuildService do job_artifacts_sast job_artifacts_dependency_scanning job_artifacts_container_scanning job_artifacts_dast job_artifacts_license_management job_artifacts_performance - job_artifacts_codequality scheduled_at].freeze + job_artifacts_codequality job_artifacts_metrics scheduled_at].freeze IGNORE_ACCESSORS = %i[type lock_version target_url base_tags trace_sections |