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
Léo-Paul Géneau
gitlab-ce
Commits
bdb06db0
Commit
bdb06db0
authored
Sep 05, 2018
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve MetricGroup specs
parent
a3fbaffc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
spec/lib/gitlab/prometheus/metric_group_spec.rb
spec/lib/gitlab/prometheus/metric_group_spec.rb
+8
-3
No files found.
spec/lib/gitlab/prometheus/metric_group_spec.rb
View file @
bdb06db0
...
...
@@ -12,7 +12,8 @@ describe Gitlab::Prometheus::MetricGroup do
subject
{
described_class
.
common_metrics
}
it
'returns exactly two groups'
do
expect
(
subject
.
map
(
&
:name
)).
to
contain_exactly
(
'Response metrics (AWS ELB)'
,
'System metrics (Kubernetes)'
)
expect
(
subject
.
map
(
&
:name
)).
to
contain_exactly
(
'Response metrics (AWS ELB)'
,
'System metrics (Kubernetes)'
)
end
it
'returns exactly three metric queries'
do
...
...
@@ -27,10 +28,14 @@ describe Gitlab::Prometheus::MetricGroup do
let!
(
:project_metric
)
{
create
(
:prometheus_metric
)
}
let!
(
:common_metric
)
{
create
(
:prometheus_metric
,
:common
,
group: :aws_elb
)
}
subject
{
described_class
.
for_project
(
other_project
)
}
subject
do
described_class
.
for_project
(
other_project
)
.
map
(
&
:metrics
).
flatten
.
map
(
&
:id
)
end
it
'returns exactly one common metric'
do
expect
(
subject
.
map
(
&
:metrics
).
flatten
.
map
(
&
:id
))
.
to
contain_exactly
(
common_metric
.
id
)
is_expected
.
to
contain_exactly
(
common_metric
.
id
)
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