Commit f5fbc5f4 authored by Piotr Skorupa's avatar Piotr Skorupa

Add stubbing Prometheus requests from UsageData

parent 5b5fde34
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment