Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
cceec81bd44f
Commit
b243c3ea
authored
Aug 01, 2017
by
Pawel Chojnacki
Browse files
Give metric query context rspec examples correctly sounding names. + missing whitespace
parent
d44fcbdda21f
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/gitlab/prometheus/queries/query_additional_metrics.rb
View file @
cceec81b
...
...
@@ -51,6 +51,7 @@ def process_query(context, query)
query
[
:query
]
%=
context
client_query
(
query
[
:query
],
time:
context
[
:timeframe_end
])
end
query
[
:result
]
=
result
&
.
map
(
&
:deep_symbolize_keys
)
query
end
...
...
spec/support/prometheus/additional_metrics_shared_examples.rb
View file @
cceec81b
...
...
@@ -23,13 +23,13 @@
subject!
{
described_class
.
new
(
client
)
}
shared_examples
'query context containing environment slug and filter'
do
it
'
query context
contains ci_environment_slug'
do
it
'contains ci_environment_slug'
do
expect
(
subject
).
to
receive
(
:query_metrics
).
with
(
hash_including
(
ci_environment_slug:
environment
.
slug
))
subject
.
query
(
*
query_params
)
end
it
'
query context
contains environment filter'
do
it
'contains environment filter'
do
expect
(
subject
).
to
receive
(
:query_metrics
).
with
(
hash_including
(
environment_filter:
"container_name!=
\"
POD
\"
,environment=
\"
#{
environment
.
slug
}
\"
"
...
...
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