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
f5fbc5f4
Commit
f5fbc5f4
authored
Mar 16, 2021
by
Piotr Skorupa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add stubbing Prometheus requests from UsageData
parent
5b5fde34
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
spec/lib/generators/gitlab/usage_metric_definition/redis_hll_generator_spec.rb
...itlab/usage_metric_definition/redis_hll_generator_spec.rb
+14
-0
No files found.
spec/lib/generators/gitlab/usage_metric_definition/redis_hll_generator_spec.rb
View file @
f5fbc5f4
...
...
@@ -12,6 +12,20 @@ RSpec.describe Gitlab::UsageMetricDefinition::RedisHllGenerator do
# See https://github.com/rspec/rspec-mocks/issues/1079
before
do
stub_const
(
"
#{
Gitlab
::
UsageMetricDefinitionGenerator
}
::TOP_LEVEL_DIR"
,
temp_dir
)
# Stub Prometheus requests from Gitlab::Utils::UsageData
stub_request
(
:get
,
%r{^http[s]?://::1:9090/-/ready}
)
.
to_return
(
status:
200
,
body:
[{}].
to_json
,
headers:
{
'Content-Type'
=>
'application/json'
}
)
stub_request
(
:get
,
%r{^http[s]?://::1:9090/api/v1/query
\?
query=.*}
)
.
to_return
(
status:
200
,
body:
[{}].
to_json
,
headers:
{
'Content-Type'
=>
'application/json'
}
)
end
it
'creates metric definition files'
do
...
...
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