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
1a07d834
Commit
1a07d834
authored
Mar 05, 2018
by
Pawel Chojnacki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add cluster query spec
parent
e8015572
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
ee/spec/lib/gitlab/prometheus/queries/cluster_query_spec.rb
ee/spec/lib/gitlab/prometheus/queries/cluster_query_spec.rb
+22
-0
No files found.
ee/spec/lib/gitlab/prometheus/queries/cluster_query_spec.rb
0 → 100644
View file @
1a07d834
require
'spec_helper'
describe
Gitlab
::
Prometheus
::
Queries
::
ClusterQuery
do
let
(
:client
)
{
double
(
'prometheus_client'
,
query_range:
nil
)
}
subject
{
described_class
.
new
(
client
)
}
around
do
|
example
|
Timecop
.
freeze
{
example
.
run
}
end
it
'load cluster metrics from yaml'
do
expect
(
Gitlab
::
Prometheus
::
AdditionalMetricsParser
).
to
receive
(
:load_groups_from_yaml
).
with
(
'cluster_metrics.yml'
).
and_call_original
subject
.
query
end
it
'sends queries to prometheus'
do
subject
.
query
expect
(
client
).
to
have_received
(
:query_range
).
with
(
anything
,
start:
8
.
hours
.
ago
,
stop:
Time
.
now
).
at_least
(
1
)
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