summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2019-08-07 08:15:34 +0000
committerSean McGivern <sean@gitlab.com>2019-08-07 08:15:34 +0000
commit353746ea51b4f2a8b0ac1d798a5285b970654123 (patch)
treec17504a7996d6be20f7ae733351aea1cb55b63be
parent3c29ea01d16b384c7138a49edee245a4c0307cdd (diff)
parent4f600340b7887fd213f8d867bb11db28999f3d07 (diff)
downloadgitlab-ce-353746ea51b4f2a8b0ac1d798a5285b970654123.tar.gz
Merge branch '33401-follow-up-from-add-prometheus-metrics-endpoint-and-basic-infrastructure-to-meter-code' into 'master'
Clean tmpdirs in metrics endpoint specs Closes #33401 See merge request gitlab-org/gitlab-ce!31529
-rw-r--r--spec/controllers/metrics_controller_spec.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/controllers/metrics_controller_spec.rb b/spec/controllers/metrics_controller_spec.rb
index 84027119491..7fb3578cd0a 100644
--- a/spec/controllers/metrics_controller_spec.rb
+++ b/spec/controllers/metrics_controller_spec.rb
@@ -5,12 +5,19 @@ require 'spec_helper'
describe MetricsController do
include StubENV
- let(:metrics_multiproc_dir) { Dir.mktmpdir }
+ let(:metrics_multiproc_dir) { @metrics_multiproc_dir }
let(:whitelisted_ip) { '127.0.0.1' }
let(:whitelisted_ip_range) { '10.0.0.0/24' }
let(:ip_in_whitelisted_range) { '10.0.0.1' }
let(:not_whitelisted_ip) { '10.0.1.1' }
+ around do |example|
+ Dir.mktmpdir do |path|
+ @metrics_multiproc_dir = path
+ example.run
+ end
+ end
+
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
allow(Prometheus::Client.configuration).to receive(:multiprocess_files_dir).and_return(metrics_multiproc_dir)