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
80a6a3e1
Commit
80a6a3e1
authored
Feb 16, 2022
by
Jordan
Committed by
Rémy Coutable
Feb 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `system-err` if no failure/error message was given in JUnit output
Changelog: changed
parent
81db390a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
lib/gitlab/ci/parsers/test/junit.rb
lib/gitlab/ci/parsers/test/junit.rb
+2
-2
spec/lib/gitlab/ci/parsers/test/junit_spec.rb
spec/lib/gitlab/ci/parsers/test/junit_spec.rb
+26
-0
No files found.
lib/gitlab/ci/parsers/test/junit.rb
View file @
80a6a3e1
...
...
@@ -64,11 +64,11 @@ module Gitlab
def
create_test_case
(
data
,
test_suite
,
job
)
if
data
.
key?
(
'failure'
)
status
=
::
Gitlab
::
Ci
::
Reports
::
TestCase
::
STATUS_FAILED
system_output
=
data
[
'failure'
]
system_output
=
data
[
'failure'
]
||
data
[
'system_err'
]
attachment
=
attachment_path
(
data
[
'system_out'
])
elsif
data
.
key?
(
'error'
)
status
=
::
Gitlab
::
Ci
::
Reports
::
TestCase
::
STATUS_ERROR
system_output
=
data
[
'error'
]
system_output
=
data
[
'error'
]
||
data
[
'system_err'
]
attachment
=
attachment_path
(
data
[
'system_out'
])
elsif
data
.
key?
(
'skipped'
)
status
=
::
Gitlab
::
Ci
::
Reports
::
TestCase
::
STATUS_SKIPPED
...
...
spec/lib/gitlab/ci/parsers/test/junit_spec.rb
View file @
80a6a3e1
...
...
@@ -99,6 +99,19 @@ RSpec.describe Gitlab::Ci::Parsers::Test::Junit do
'Some failure'
end
context
'and has failure with no message but has system-err'
do
let
(
:testcase_content
)
do
<<-
EOF
.
strip_heredoc
<failure></failure>
<system-err>Some failure</system-err>
EOF
end
it_behaves_like
'<testcase> XML parser'
,
::
Gitlab
::
Ci
::
Reports
::
TestCase
::
STATUS_FAILED
,
'Some failure'
end
context
'and has error'
do
let
(
:testcase_content
)
{
'<error>Some error</error>'
}
...
...
@@ -107,6 +120,19 @@ RSpec.describe Gitlab::Ci::Parsers::Test::Junit do
'Some error'
end
context
'and has error with no message but has system-err'
do
let
(
:testcase_content
)
do
<<-
EOF
.
strip_heredoc
<error></error>
<system-err>Some error</system-err>
EOF
end
it_behaves_like
'<testcase> XML parser'
,
::
Gitlab
::
Ci
::
Reports
::
TestCase
::
STATUS_ERROR
,
'Some error'
end
context
'and has skipped'
do
let
(
:testcase_content
)
{
'<skipped/>'
}
...
...
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