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
768d4f55
Commit
768d4f55
authored
Oct 07, 2019
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feature gate PipelinesController#test_report
parent
226467f2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
20 deletions
+43
-20
app/controllers/projects/pipelines_controller.rb
app/controllers/projects/pipelines_controller.rb
+2
-0
spec/controllers/projects/pipelines_controller_spec.rb
spec/controllers/projects/pipelines_controller_spec.rb
+41
-20
No files found.
app/controllers/projects/pipelines_controller.rb
View file @
768d4f55
...
...
@@ -154,6 +154,8 @@ class Projects::PipelinesController < Projects::ApplicationController
end
def
test_report
return
unless
Feature
.
enabled?
(
:junit_pipeline_view
,
project
)
if
pipeline_test_report
==
:error
render
json:
{
status: :error_parsing_report
}
return
...
...
spec/controllers/projects/pipelines_controller_spec.rb
View file @
768d4f55
...
...
@@ -408,6 +408,11 @@ describe Projects::PipelinesController do
format: :json
end
context
'when feature is enabled'
do
before
do
stub_feature_flags
(
junit_pipeline_view:
true
)
end
context
'when pipeline does not have a test report'
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
...
...
@@ -447,6 +452,22 @@ describe Projects::PipelinesController do
end
end
context
'when feature is disabled'
do
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
,
project:
project
)
}
before
do
stub_feature_flags
(
junit_pipeline_view:
false
)
end
it
'renders empty response'
do
get_test_report_json
expect
(
response
).
to
have_gitlab_http_status
(
:no_content
)
expect
(
response
.
body
).
to
be_empty
end
end
end
describe
'GET latest'
do
let
(
:branch_main
)
{
project
.
repository
.
branches
[
0
]
}
let
(
:branch_secondary
)
{
project
.
repository
.
branches
[
1
]
}
...
...
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