diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-05-29 13:08:52 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-05-29 13:08:52 +0300 |
commit | 328740c61327f20c18b43b5015d4411897a24c3c (patch) | |
tree | 8e1e2fbdbf9dffba8da029335bb87d91832a37e1 /spec/models | |
parent | f139ce9d64e4053a33ead292a8dce46b510e8848 (diff) | |
parent | 1542b160f18b30a8ec28fbdc9c52694b5dfd6f62 (diff) |
Merge branch 'mc/feature/reports-download' into 'master'
Allow downloading report artifacts
Closes #49265
See merge request gitlab-org/gitlab-ce!27974
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/ci/build_spec.rb | 12 | ||||
-rw-r--r-- | spec/models/ci/job_artifact_spec.rb | 15 |
2 files changed, 27 insertions, 0 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index bc81c34f7ab..32eef9e0e01 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -3490,6 +3490,18 @@ describe Ci::Build do end end + describe '#report_artifacts' do + subject { build.report_artifacts } + + context 'when the build has reports' do + let!(:report) { create(:ci_job_artifact, :codequality, job: build) } + + it 'returns the artifacts with reports' do + expect(subject).to contain_exactly(report) + end + end + end + describe '#artifacts_metadata_entry' do set(:build) { create(:ci_build, project: project) } let(:path) { 'other_artifacts_0.1.2/another-subdirectory/banana_sample.gif' } diff --git a/spec/models/ci/job_artifact_spec.rb b/spec/models/ci/job_artifact_spec.rb index 5964f66c398..e6d682c24d9 100644 --- a/spec/models/ci/job_artifact_spec.rb +++ b/spec/models/ci/job_artifact_spec.rb @@ -23,6 +23,21 @@ describe Ci::JobArtifact do it_behaves_like 'having unique enum values' + describe '.with_reports' do + let!(:artifact) { create(:ci_job_artifact, :archive) } + + subject { described_class.with_reports } + + it { is_expected.to be_empty } + + context 'when there are reports' do + let!(:metrics_report) { create(:ci_job_artifact, :junit) } + let!(:codequality_report) { create(:ci_job_artifact, :codequality) } + + it { is_expected.to eq([metrics_report, codequality_report]) } + end + end + describe '.test_reports' do subject { described_class.test_reports } |