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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
8980b714
Commit
8980b714
authored
Jun 05, 2019
by
Simon Knox
Committed by
syasonik
Jun 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return no_content from prometheus API empty response
parent
e53f475e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/controllers/projects/environments/prometheus_api_controller.rb
...ollers/projects/environments/prometheus_api_controller.rb
+1
-1
spec/controllers/projects/environments/prometheus_api_controller_spec.rb
...s/projects/environments/prometheus_api_controller_spec.rb
+2
-2
No files found.
app/controllers/projects/environments/prometheus_api_controller.rb
View file @
8980b714
...
@@ -13,7 +13,7 @@ class Projects::Environments::PrometheusApiController < Projects::ApplicationCon
...
@@ -13,7 +13,7 @@ class Projects::Environments::PrometheusApiController < Projects::ApplicationCon
).
execute
).
execute
if
result
.
nil?
if
result
.
nil?
return
render
status: :
accepted
,
json:
{
return
render
status: :
no_content
,
json:
{
status:
_
(
'processing'
),
status:
_
(
'processing'
),
message:
_
(
'Not ready yet. Try again later.'
)
message:
_
(
'Not ready yet. Try again later.'
)
}
}
...
...
spec/controllers/projects/environments/prometheus_api_controller_spec.rb
View file @
8980b714
...
@@ -85,12 +85,12 @@ describe Projects::Environments::PrometheusApiController do
...
@@ -85,12 +85,12 @@ describe Projects::Environments::PrometheusApiController do
context
'with nil result'
do
context
'with nil result'
do
let
(
:service_result
)
{
nil
}
let
(
:service_result
)
{
nil
}
it
'returns 20
2 accepted
'
do
it
'returns 20
4 no_content
'
do
get
:proxy
,
params:
environment_params
get
:proxy
,
params:
environment_params
expect
(
json_response
[
'status'
]).
to
eq
(
'processing'
)
expect
(
json_response
[
'status'
]).
to
eq
(
'processing'
)
expect
(
json_response
[
'message'
]).
to
eq
(
'Not ready yet. Try again later.'
)
expect
(
json_response
[
'message'
]).
to
eq
(
'Not ready yet. Try again later.'
)
expect
(
response
).
to
have_gitlab_http_status
(
:
accepted
)
expect
(
response
).
to
have_gitlab_http_status
(
:
no_content
)
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