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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
d8d3db7f
Commit
d8d3db7f
authored
Oct 04, 2019
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle test_reports erroring out
parent
09813909
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
app/serializers/pipeline_details_entity.rb
app/serializers/pipeline_details_entity.rb
+2
-0
spec/serializers/pipeline_details_entity_spec.rb
spec/serializers/pipeline_details_entity_spec.rb
+17
-0
No files found.
app/serializers/pipeline_details_entity.rb
View file @
d8d3db7f
...
...
@@ -9,6 +9,8 @@ class PipelineDetailsEntity < PipelineEntity
expose
:artifacts
,
using:
BuildArtifactEntity
expose
:test_reports
,
using:
TestReportEntity
do
|
pipeline
|
pipeline
.
test_reports
.
total_count
.
zero?
?
nil
:
pipeline
.
test_reports
rescue
nil
end
expose
:manual_actions
,
using:
BuildActionEntity
expose
:scheduled_actions
,
using:
BuildActionEntity
...
...
spec/serializers/pipeline_details_entity_spec.rb
View file @
d8d3db7f
...
...
@@ -121,6 +121,23 @@ describe PipelineDetailsEntity do
expect
(
subject
[
:details
]).
to
include
(
:test_reports
)
expect
(
subject
[
:details
][
:test_reports
][
:total_time
]).
to
eq
(
pipeline
.
test_reports
.
total_time
)
end
context
'when pipeline has corrupt test reports'
do
before
do
job
=
create
(
:ci_build
,
pipeline:
pipeline
)
create
(
:ci_job_artifact
,
:junit_with_corrupted_data
,
job:
job
)
end
it
'does not error out'
do
expect
{
subject
}.
not_to
raise_error
end
it
'shows an empty test_reports section'
do
expect
(
subject
).
to
include
(
:details
)
expect
(
subject
[
:details
]).
to
include
(
:test_reports
)
expect
(
subject
[
:details
][
:test_reports
]).
to
eq
(
nil
)
end
end
end
context
'when pipeline has YAML errors'
do
...
...
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