diff options
author | Peter Leitzen <pleitzen@gitlab.com> | 2019-08-07 08:15:33 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-08-07 08:15:33 +0000 |
commit | 4f600340b7887fd213f8d867bb11db28999f3d07 (patch) | |
tree | c17504a7996d6be20f7ae733351aea1cb55b63be /spec/controllers/metrics_controller_spec.rb | |
parent | 3c29ea01d16b384c7138a49edee245a4c0307cdd (diff) | |
download | gitlab-ce-4f600340b7887fd213f8d867bb11db28999f3d07.tar.gz |
Clean tmpdirs in metrics endpoint specs
Diffstat (limited to 'spec/controllers/metrics_controller_spec.rb')
-rw-r--r-- | spec/controllers/metrics_controller_spec.rb | 9 |
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) |