BigW Consortium Gitlab

Commit 21561f34 by Pawel Chojnacki

Correctly handle temporary folder for testing multiproces metrics

parent ef9d9dde
......@@ -269,9 +269,9 @@ group :metrics do
gem 'method_source', '~> 0.8', require: false
gem 'influxdb', '~> 0.2', require: false
# Prometheus
# Prometheus
gem 'mmap2', '~> 2.2.6'
gem 'prometheus-client-mmap'
gem 'prometheus-client-mmap', '~>0.7.0.beta3'
end
group :development do
......
......@@ -1000,7 +1000,7 @@ DEPENDENCIES
pg (~> 0.18.2)
poltergeist (~> 1.9.0)
premailer-rails (~> 1.9.0)
prometheus-client-mmap
prometheus-client-mmap (~> 0.7.0.beta3)
pry-byebug (~> 3.4.1)
pry-rails (~> 0.3.4)
rack-attack (~> 4.4.1)
......
......@@ -7,7 +7,7 @@ class MetricsController < ActionController::Base
CHECKS = [
Gitlab::HealthChecks::DbCheck,
Gitlab::HealthChecks::RedisCheck,
Gitlab::HealthChecks::FsShardsCheck,
Gitlab::HealthChecks::FsShardsCheck
].freeze
def metrics
......
......@@ -6,8 +6,17 @@ describe MetricsController do
let(:token) { current_application_settings.health_check_access_token }
let(:json_response) { JSON.parse(response.body) }
around do |examples|
Dir.mktmpdir do |tmp_dir|
@metrics_multiproc_dir = tmp_dir
examples.run
end
end
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
stub_env('prometheus_multiproc_dir', @metrics_multiproc_dir)
allow(Gitlab::Metrics).to receive(:prometheus_metrics_enabled?).and_return(true)
end
describe '#metrics' do
......
......@@ -243,7 +243,6 @@ describe Gitlab::Metrics do
subject { described_class.counter(:counter, 'doc') }
it { is_expected.to be_a(Gitlab::Metrics::DummyMetric) }
end
describe '#summary' 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