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
dd910ae2
Commit
dd910ae2
authored
Jun 01, 2021
by
Maxime Orefice
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'mo-strip-out-junit-screenshot-path' into 'master'"
This reverts merge request !62520
parent
9258c973
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
35 deletions
+3
-35
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+1
-1
lib/gitlab/ci/parsers/test/junit.rb
lib/gitlab/ci/parsers/test/junit.rb
+0
-6
spec/lib/gitlab/ci/parsers/test/junit_spec.rb
spec/lib/gitlab/ci/parsers/test/junit_spec.rb
+1
-28
spec/support/capybara.rb
spec/support/capybara.rb
+1
-0
No files found.
app/models/ci/pipeline.rb
View file @
dd910ae2
...
...
@@ -994,7 +994,7 @@ module Ci
end
def
latest_test_report_builds
latest_report_builds
(
Ci
::
JobArtifact
.
test_reports
).
preload
(
:project
,
:job_variables
,
:metadata
)
latest_report_builds
(
Ci
::
JobArtifact
.
test_reports
).
preload
(
:project
)
end
def
builds_with_coverage
...
...
lib/gitlab/ci/parsers/test/junit.rb
View file @
dd910ae2
...
...
@@ -66,12 +66,10 @@ module Gitlab
status
=
::
Gitlab
::
Ci
::
Reports
::
TestCase
::
STATUS_FAILED
system_output
=
data
[
'failure'
]
attachment
=
attachment_path
(
data
[
'system_out'
])
attachment
=
remove_project_prefix
(
attachment
,
job
)
elsif
data
.
key?
(
'error'
)
status
=
::
Gitlab
::
Ci
::
Reports
::
TestCase
::
STATUS_ERROR
system_output
=
data
[
'error'
]
attachment
=
attachment_path
(
data
[
'system_out'
])
attachment
=
remove_project_prefix
(
attachment
,
job
)
elsif
data
.
key?
(
'skipped'
)
status
=
::
Gitlab
::
Ci
::
Reports
::
TestCase
::
STATUS_SKIPPED
system_output
=
data
[
'skipped'
]
...
...
@@ -103,10 +101,6 @@ module Gitlab
matches
=
data
.
match
(
ATTACHMENT_TAG_REGEX
)
matches
[
:path
]
if
matches
end
def
remove_project_prefix
(
attachment
,
job
)
attachment
&
.
delete_prefix
(
job
.
variables
[
'CI_PROJECT_DIR'
]
&
.
value
||
''
)
end
end
end
end
...
...
spec/lib/gitlab/ci/parsers/test/junit_spec.rb
View file @
dd910ae2
...
...
@@ -8,14 +8,8 @@ RSpec.describe Gitlab::Ci::Parsers::Test::Junit do
let
(
:test_suite
)
{
Gitlab
::
Ci
::
Reports
::
TestSuite
.
new
(
'rspec'
)
}
let
(
:test_cases
)
{
flattened_test_cases
(
test_suite
)
}
let
(
:
variables
)
{
[{
key:
'CI_PROJECT_DIR'
,
value:
'/builds/group/project'
}]
}
let
(
:
job
)
{
double
(
max_test_cases_per_report:
max_test_cases
)
}
let
(
:max_test_cases
)
{
0
}
let
(
:job
)
do
double
(
max_test_cases_per_report:
max_test_cases
,
variables:
Gitlab
::
Ci
::
Variables
::
Collection
.
new
.
concat
(
variables
)
)
end
context
'when data is JUnit style XML'
do
context
'when there are no <testcases> in <testsuite>'
do
...
...
@@ -423,27 +417,6 @@ RSpec.describe Gitlab::Ci::Parsers::Test::Junit do
end
end
context
'when paths contains the build group project path'
do
let
(
:junit
)
do
<<~
EOF
<testsuites>
<testsuite>
<testcase classname='Calculator' name='sumTest1' time='0.01'>
<failure>Some failure</failure>
<system-out>[[ATTACHMENT|/builds/group/project/some/path.png]]</system-out>
</testcase>
</testsuite>
</testsuites>
EOF
end
it
'removes the builds group project path prefix'
do
expect
{
subject
}.
not_to
raise_error
expect
(
test_cases
[
0
].
attachment
).
to
eq
(
"/some/path.png"
)
end
end
context
'when attachment is specified in test case with error'
do
let
(
:junit
)
do
<<~
EOF
...
...
spec/support/capybara.rb
View file @
dd910ae2
...
...
@@ -177,6 +177,7 @@ RSpec.configure do |config|
config
.
append_after
do
|
example
|
if
example
.
metadata
[
:screenshot
]
screenshot
=
example
.
metadata
[
:screenshot
][
:image
]
||
example
.
metadata
[
:screenshot
][
:html
]
screenshot
&
.
delete_prefix!
(
ENV
.
fetch
(
'CI_PROJECT_DIR'
,
''
))
example
.
metadata
[
:stdout
]
=
%{[[ATTACHMENT|#{screenshot}]]}
end
end
...
...
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