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
a748f054
Commit
a748f054
authored
Mar 25, 2020
by
drew cimino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Detect skipped specs in JUnit reports and set TestCase status
parent
4000aba0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
+24
-2
changelogs/unreleased/parse-skipped-specs-from-junit-reports.yml
...ogs/unreleased/parse-skipped-specs-from-junit-reports.yml
+5
-0
lib/gitlab/ci/parsers/test/junit.rb
lib/gitlab/ci/parsers/test/junit.rb
+5
-2
spec/lib/gitlab/ci/parsers/test/junit_spec.rb
spec/lib/gitlab/ci/parsers/test/junit_spec.rb
+14
-0
No files found.
changelogs/unreleased/parse-skipped-specs-from-junit-reports.yml
0 → 100644
View file @
a748f054
---
title
:
Detect skipped specs in JUnit reports and set TestCase status
merge_request
:
28053
author
:
type
:
fixed
lib/gitlab/ci/parsers/test/junit.rb
View file @
a748f054
...
...
@@ -47,13 +47,16 @@ module Gitlab
end
def
create_test_case
(
data
,
args
)
if
data
[
'failure'
]
if
data
.
key?
(
'failure'
)
status
=
::
Gitlab
::
Ci
::
Reports
::
TestCase
::
STATUS_FAILED
system_output
=
data
[
'failure'
]
attachment
=
attachment_path
(
data
[
'system_out'
])
elsif
data
[
'error'
]
elsif
data
.
key?
(
'error'
)
status
=
::
Gitlab
::
Ci
::
Reports
::
TestCase
::
STATUS_ERROR
system_output
=
data
[
'error'
]
elsif
data
.
key?
(
'skipped'
)
status
=
::
Gitlab
::
Ci
::
Reports
::
TestCase
::
STATUS_SKIPPED
system_output
=
data
[
'skipped'
]
else
status
=
::
Gitlab
::
Ci
::
Reports
::
TestCase
::
STATUS_SUCCESS
system_output
=
nil
...
...
spec/lib/gitlab/ci/parsers/test/junit_spec.rb
View file @
a748f054
...
...
@@ -104,6 +104,20 @@ describe Gitlab::Ci::Parsers::Test::Junit do
'Some error'
end
context
'and has skipped'
do
let
(
:testcase_content
)
{
'<skipped/>'
}
it_behaves_like
'<testcase> XML parser'
,
::
Gitlab
::
Ci
::
Reports
::
TestCase
::
STATUS_SKIPPED
,
nil
context
'with an empty double-tag'
do
let
(
:testcase_content
)
{
'<skipped></skipped>'
}
it_behaves_like
'<testcase> XML parser'
,
::
Gitlab
::
Ci
::
Reports
::
TestCase
::
STATUS_SKIPPED
,
nil
end
end
context
'and has an unknown type'
do
let
(
:testcase_content
)
{
'<foo>Some foo</foo>'
}
...
...
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