Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
51183ad3
Commit
51183ad3
authored
May 01, 2019
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add all reports scope to Ci::JobArtifact
parent
df7bebd6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
app/models/ci/job_artifact.rb
app/models/ci/job_artifact.rb
+4
-0
spec/models/ci/job_artifact_spec.rb
spec/models/ci/job_artifact_spec.rb
+15
-0
No files found.
app/models/ci/job_artifact.rb
View file @
51183ad3
...
...
@@ -66,6 +66,10 @@ module Ci
where
(
file_type:
types
)
end
scope
:with_all_reports
,
->
do
where
(
file_type:
self
.
file_types
.
values
.
drop
(
3
))
end
scope
:test_reports
,
->
do
with_file_types
(
TEST_REPORT_FILE_TYPES
)
end
...
...
spec/models/ci/job_artifact_spec.rb
View file @
51183ad3
...
...
@@ -23,6 +23,21 @@ describe Ci::JobArtifact do
it_behaves_like
'having unique enum values'
describe
'.with_all_reports'
do
let!
(
:artifact
)
{
create
(
:ci_job_artifact
,
:archive
)
}
subject
{
described_class
.
with_all_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
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment