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
7132fcf7
Commit
7132fcf7
authored
Apr 09, 2020
by
Maxime Orefice
Committed by
Douglas Barbosa Alexandre
Apr 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix JUnit screenshot feature flag
parent
3824edb1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
13 deletions
+37
-13
app/controllers/projects/pipelines_controller.rb
app/controllers/projects/pipelines_controller.rb
+1
-1
spec/controllers/projects/pipelines_controller_spec.rb
spec/controllers/projects/pipelines_controller_spec.rb
+36
-12
No files found.
app/controllers/projects/pipelines_controller.rb
View file @
7132fcf7
...
@@ -180,7 +180,7 @@ class Projects::PipelinesController < Projects::ApplicationController
...
@@ -180,7 +180,7 @@ class Projects::PipelinesController < Projects::ApplicationController
render
json:
TestReportSerializer
render
json:
TestReportSerializer
.
new
(
current_user:
@current_user
)
.
new
(
current_user:
@current_user
)
.
represent
(
test_reports
)
.
represent
(
test_reports
,
project:
project
)
end
end
end
end
end
end
...
...
spec/controllers/projects/pipelines_controller_spec.rb
View file @
7132fcf7
...
@@ -789,25 +789,49 @@ describe Projects::PipelinesController do
...
@@ -789,25 +789,49 @@ describe Projects::PipelinesController do
end
end
end
end
context
'when test_report contains attachment and scope is with_attachment as a URL param'
do
context
'when junit_pipeline_screenshots_view is enabled'
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
:with_test_reports_attachment
,
project:
project
)
}
before
do
stub_feature_flags
(
junit_pipeline_screenshots_view:
{
enabled:
true
,
thing:
project
})
end
it
'returns a test reports with attachment
'
do
context
'when test_report contains attachment and scope is with_attachment as a URL param
'
do
get_test_report_json
(
scope:
'with_attachment'
)
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
:with_test_reports_attachment
,
project:
project
)
}
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
it
'returns a test reports with attachment'
do
expect
(
json_response
[
"test_suites"
]).
to
be_present
get_test_report_json
(
scope:
'with_attachment'
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
[
"test_suites"
]).
to
be_present
expect
(
json_response
[
"test_suites"
].
first
[
"test_cases"
].
first
).
to
include
(
"attachment_url"
)
end
end
context
'when test_report does not contain attachment and scope is with_attachment as a URL param'
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
:with_test_reports
,
project:
project
)
}
it
'returns a test reports with empty values'
do
get_test_report_json
(
scope:
'with_attachment'
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
[
"test_suites"
]).
to
be_empty
end
end
end
end
end
context
'when test_report does not contain attachment and scope is with_attachment as a URL param'
do
context
'when junit_pipeline_screenshots_view is disabled'
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
:with_test_reports
,
project:
project
)
}
before
do
stub_feature_flags
(
junit_pipeline_screenshots_view:
{
enabled:
false
,
thing:
project
})
end
it
'returns a test reports with empty values
'
do
context
'when test_report contains attachment and scope is with_attachment as a URL param
'
do
get_test_report_json
(
scope:
'with_attachment'
)
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
:with_test_reports_attachment
,
project:
project
)
}
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
it
'returns a test reports without attachment_url'
do
expect
(
json_response
[
"test_suites"
]).
to
be_empty
get_test_report_json
(
scope:
'with_attachment'
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
[
"test_suites"
].
first
[
"test_cases"
].
first
).
not_to
include
(
"attachment_url"
)
end
end
end
end
end
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