Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPawel Chojnacki <pawel@chojnacki.ws>2017-05-22 20:49:34 +0300
committerPawel Chojnacki <pawel@chojnacki.ws>2017-06-02 20:45:58 +0300
commit21561f3434021ad35d45c449f489802fd1dced67 (patch)
treefb245cc6f694de8cf4cdde21ad796f85158e7c9d /spec/controllers/metrics_controller_spec.rb
parentef9d9ddeb2e063fa8ed1b01e4f82cc9662b919b2 (diff)
Correctly handle temporary folder for testing multiproces metrics
Diffstat (limited to 'spec/controllers/metrics_controller_spec.rb')
-rw-r--r--spec/controllers/metrics_controller_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/controllers/metrics_controller_spec.rb b/spec/controllers/metrics_controller_spec.rb
index d2d4b361a62..7f2dcd3544f 100644
--- a/spec/controllers/metrics_controller_spec.rb
+++ b/spec/controllers/metrics_controller_spec.rb
@@ -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