2020-12-16 04:10:26 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-02-01 07:09:03 -05:00
|
|
|
# Require the provided spec helper and matchers.
|
|
|
|
require 'gitlab/experiment/rspec'
|
|
|
|
|
2021-02-23 04:10:45 -05:00
|
|
|
RSpec.configure do |config|
|
2021-03-10 10:09:11 -05:00
|
|
|
config.include StubSnowplow, :experiment
|
|
|
|
|
2021-02-23 04:10:45 -05:00
|
|
|
# Disable all caching for experiments in tests.
|
|
|
|
config.before do
|
|
|
|
allow(Gitlab::Experiment::Configuration).to receive(:cache).and_return(nil)
|
2022-02-02 16:16:54 -05:00
|
|
|
|
|
|
|
# Disable all deprecation warnings in the test environment, which can be
|
|
|
|
# resolved one by one and tracked in:
|
|
|
|
#
|
|
|
|
# https://gitlab.com/gitlab-org/gitlab/-/issues/350944
|
|
|
|
allow(Gitlab::Experiment::Configuration).to receive(:deprecator).and_wrap_original do |method, version|
|
|
|
|
method.call(version).tap do |deprecator|
|
|
|
|
deprecator.silenced = true
|
|
|
|
end
|
|
|
|
end
|
2021-02-23 04:10:45 -05:00
|
|
|
end
|
2021-03-10 10:09:11 -05:00
|
|
|
|
|
|
|
config.before(:each, :experiment) do
|
|
|
|
stub_snowplow
|
|
|
|
end
|
2021-02-23 04:10:45 -05:00
|
|
|
end
|