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
f71d243a
Commit
f71d243a
authored
Apr 02, 2019
by
rpereira2
Committed by
Peter Leitzen
Apr 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove all superfluous braces
parent
6938977a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
app/services/prometheus/proxy_service.rb
app/services/prometheus/proxy_service.rb
+0
-1
spec/services/prometheus/proxy_service_spec.rb
spec/services/prometheus/proxy_service_spec.rb
+11
-11
No files found.
app/services/prometheus/proxy_service.rb
View file @
f71d243a
...
...
@@ -61,7 +61,6 @@ module Prometheus
response
=
prometheus_client_wrapper
.
proxy
(
path
,
params
)
success
(
http_status:
response
.
code
,
body:
response
.
body
)
rescue
Gitlab
::
PrometheusClient
::
Error
=>
err
service_unavailable_response
(
err
)
end
...
...
spec/services/prometheus/proxy_service_spec.rb
View file @
f71d243a
...
...
@@ -9,7 +9,7 @@ describe Prometheus::ProxyService do
set
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
describe
'#initialize'
do
let
(
:params
)
{
ActionController
::
Parameters
.
new
(
{
query:
'1'
}
).
permit!
}
let
(
:params
)
{
ActionController
::
Parameters
.
new
(
query:
'1'
).
permit!
}
it
'initializes attributes'
do
result
=
described_class
.
new
(
environment
,
'GET'
,
'query'
,
{
query:
'1'
})
...
...
@@ -17,7 +17,7 @@ describe Prometheus::ProxyService do
expect
(
result
.
prometheus_owner
).
to
eq
(
environment
)
expect
(
result
.
method
).
to
eq
(
'GET'
)
expect
(
result
.
path
).
to
eq
(
'query'
)
expect
(
result
.
params
).
to
eq
(
{
query:
'1'
}
)
expect
(
result
.
params
).
to
eq
(
query:
'1'
)
end
it
'converts ActionController::Parameters into hash'
do
...
...
@@ -38,11 +38,11 @@ describe Prometheus::ProxyService do
end
it
'should return error'
do
expect
(
subject
.
execute
).
to
eq
(
{
expect
(
subject
.
execute
).
to
eq
(
status: :error
,
message:
'No prometheus server found'
,
http_status: :service_unavailable
}
)
)
end
end
...
...
@@ -53,11 +53,11 @@ describe Prometheus::ProxyService do
end
it
'should return error'
do
expect
(
subject
.
execute
).
to
eq
(
{
expect
(
subject
.
execute
).
to
eq
(
status: :error
,
message:
'No prometheus server found'
,
http_status: :service_unavailable
}
)
)
end
end
...
...
@@ -65,10 +65,10 @@ describe Prometheus::ProxyService do
subject
{
described_class
.
new
(
environment
,
'POST'
,
'query'
,
{
query:
'1'
})
}
it
'returns error'
do
expect
(
subject
.
execute
).
to
eq
(
{
expect
(
subject
.
execute
).
to
eq
(
message:
'Proxy support for this API is not available currently'
,
status: :error
}
)
)
end
end
...
...
@@ -159,11 +159,11 @@ describe Prometheus::ProxyService do
end
it
'returns error'
do
expect
(
subject
.
execute
).
to
eq
(
{
expect
(
subject
.
execute
).
to
eq
(
status: :error
,
message:
'Network connection error'
,
http_status: :service_unavailable
}
)
)
end
end
end
...
...
@@ -178,7 +178,7 @@ describe Prometheus::ProxyService do
expect
(
result
.
prometheus_owner
).
to
eq
(
environment
)
expect
(
result
.
method
).
to
eq
(
'GET'
)
expect
(
result
.
path
).
to
eq
(
'query'
)
expect
(
result
.
params
).
to
eq
(
{
query:
'1'
}
)
expect
(
result
.
params
).
to
eq
(
query:
'1'
)
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