diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-09-07 22:01:21 +0200 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-11-02 18:11:44 +0100 |
commit | c361c1e857fe165e7a838aea1ecf7a10982cdbe0 (patch) | |
tree | 5529f918d6d848d4e42f55e7d25cd3e3e4a7359f | |
parent | 95a23d246c9a4884b4622d9310afb2ada9552a6d (diff) | |
download | gitlab-ce-c361c1e857fe165e7a838aea1ecf7a10982cdbe0.tar.gz |
Adjust test to changed metrics methods.
+ remove deprecated test suite
-rw-r--r-- | lib/gitlab/metrics/prometheus.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/metrics/rack_middleware_spec.rb | 14 | ||||
-rw-r--r-- | spec/lib/gitlab/metrics_spec.rb | 6 |
3 files changed, 4 insertions, 18 deletions
diff --git a/lib/gitlab/metrics/prometheus.rb b/lib/gitlab/metrics/prometheus.rb index e056a3f7b43..c32f3d103b4 100644 --- a/lib/gitlab/metrics/prometheus.rb +++ b/lib/gitlab/metrics/prometheus.rb @@ -53,7 +53,7 @@ module Gitlab return metric if metric PROVIDER_MUTEX.synchronize do - provide_metric(name) || registry.send(method, *args) + provide_metric(name) || registry.send(method, name, *args) end end diff --git a/spec/lib/gitlab/metrics/rack_middleware_spec.rb b/spec/lib/gitlab/metrics/rack_middleware_spec.rb index ee12882f4c0..f6ce1805ca7 100644 --- a/spec/lib/gitlab/metrics/rack_middleware_spec.rb +++ b/spec/lib/gitlab/metrics/rack_middleware_spec.rb @@ -18,20 +18,6 @@ describe Gitlab::Metrics::RackMiddleware do expect(middleware.call(env)).to eq('yay') end - xit 'tags a transaction with the name and action of a controller' do - klass = double(:klass, name: 'TestController') - controller = double(:controller, class: klass, action_name: 'show', content_type: 'text/html') - - env['action_controller.instance'] = controller - - allow(app).to receive(:call).with(env) - - expect(middleware).to receive(:tag_controller) - .with(an_instance_of(Gitlab::Metrics::Transaction), env) - - middleware.call(env) - end - it 'tracks any raised exceptions' do expect(app).to receive(:call).with(env).and_raise(RuntimeError) diff --git a/spec/lib/gitlab/metrics_spec.rb b/spec/lib/gitlab/metrics_spec.rb index 435c420bf6a..906abdac47c 100644 --- a/spec/lib/gitlab/metrics_spec.rb +++ b/spec/lib/gitlab/metrics_spec.rb @@ -199,7 +199,7 @@ describe Gitlab::Metrics do shared_examples 'prometheus metrics API' do describe '#counter' do - subject { described_class.counter(:couter, 'doc') } + subject { described_class.counter(:counter, 'doc') } describe '#increment' do it 'successfully calls #increment without arguments' do @@ -255,7 +255,7 @@ describe Gitlab::Metrics do it_behaves_like 'prometheus metrics API' describe '#null_metric' do - subject { described_class.provide_metric(:test) } + subject { described_class.send(:provide_metric, :test) } it { is_expected.to be_a(Gitlab::Metrics::NullMetric) } end @@ -296,7 +296,7 @@ describe Gitlab::Metrics do it_behaves_like 'prometheus metrics API' describe '#null_metric' do - subject { described_class.provide_metric(:test) } + subject { described_class.send(:provide_metric, :test) } it { is_expected.to be_nil } end |