summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2019-04-16 13:06:52 +0200
committerMatija Čupić <matteeyah@gmail.com>2019-04-16 13:06:52 +0200
commit0cfa25ff21322d45aaef91fc7a3dd7c570632a05 (patch)
tree11e9c6393808c22ecb0bfd3ccee945a39029145f /spec
parentfc1dfae41c7e6e1bbaa95bc4a1e087ffddfcc57b (diff)
downloadgitlab-ce-0cfa25ff21322d45aaef91fc7a3dd7c570632a05.tar.gz
Backport changes from EE
This backports the changes from https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/10452
Diffstat (limited to 'spec')
-rw-r--r--spec/models/ci/build_spec.rb4
-rw-r--r--spec/models/ci/pipeline_spec.rb24
-rw-r--r--spec/services/ci/retry_build_service_spec.rb2
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 f3e78630c1b..f8d7579ab6a 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 }
@@ -2728,8 +2748,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 17e2b17a499..ce3b1fe30e6 100644
--- a/spec/services/ci/retry_build_service_spec.rb
+++ b/spec/services/ci/retry_build_service_spec.rb
@@ -28,7 +28,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