gitlab-org--gitlab-foss/spec/initializers/zz_metrics_spec.rb
Lin Jen-Shin 77b8c2c176 Always load the metrics the last
Because this could potentially load a model and we shouldn't
load models before all the patches we have in places.
2018-12-21 00:53:45 +08:00

22 lines
769 B
Ruby

require 'spec_helper'
describe 'instrument_classes' do
let(:config) { double(:config) }
let(:influx_sampler) { double(:influx_sampler) }
before do
allow(config).to receive(:instrument_method)
allow(config).to receive(:instrument_methods)
allow(config).to receive(:instrument_instance_method)
allow(config).to receive(:instrument_instance_methods)
allow(Gitlab::Metrics::Samplers::InfluxSampler).to receive(:initialize_instance).and_return(influx_sampler)
allow(influx_sampler).to receive(:start)
allow(Gitlab::Application).to receive(:configure)
end
it 'can autoload and instrument all files' do
require_relative '../../config/initializers/zz_metrics'
expect { instrument_classes(config) }.not_to raise_error
end
end