2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-10-11 01:57:18 +05:30
|
|
|
require_relative "rspec_order"
|
|
|
|
require_relative "system_exit_detected"
|
2018-10-15 14:42:47 +05:30
|
|
|
require_relative "helpers/stub_configuration"
|
2018-11-18 11:00:15 +05:30
|
|
|
require_relative "helpers/stub_metrics"
|
2018-10-15 14:42:47 +05:30
|
|
|
require_relative "helpers/stub_object_storage"
|
|
|
|
require_relative "helpers/stub_env"
|
2020-07-28 23:09:34 +05:30
|
|
|
require_relative "helpers/fast_rails_root"
|
2021-01-29 00:20:46 +05:30
|
|
|
|
2022-07-16 23:28:13 +05:30
|
|
|
RSpec::Expectations.configuration.on_potential_false_positives = :raise
|
|
|
|
|
2018-10-15 14:42:47 +05:30
|
|
|
RSpec.configure do |config|
|
2023-01-13 00:05:48 +05:30
|
|
|
# See https://gitlab.com/gitlab-org/gitlab/-/issues/379686
|
|
|
|
config.threadsafe = false
|
|
|
|
|
2022-10-11 01:57:18 +05:30
|
|
|
# Re-run failures locally with `--only-failures`
|
|
|
|
config.example_status_persistence_file_path = ENV.fetch('RSPEC_LAST_RUN_RESULTS_FILE', './spec/examples.txt')
|
|
|
|
|
|
|
|
unless ENV['CI']
|
|
|
|
# Allow running `:focus` examples locally,
|
|
|
|
# falling back to all tests when there is no `:focus` example.
|
|
|
|
config.filter_run focus: true
|
|
|
|
config.run_all_when_everything_filtered = true
|
|
|
|
end
|
|
|
|
|
2022-01-26 12:08:38 +05:30
|
|
|
config.mock_with :rspec do |mocks|
|
|
|
|
mocks.verify_doubled_constant_names = true
|
|
|
|
end
|
|
|
|
|
2018-10-15 14:42:47 +05:30
|
|
|
config.raise_errors_for_deprecations!
|
|
|
|
|
|
|
|
config.include StubConfiguration
|
2018-11-18 11:00:15 +05:30
|
|
|
config.include StubMetrics
|
2018-10-15 14:42:47 +05:30
|
|
|
config.include StubObjectStorage
|
|
|
|
config.include StubENV
|
2020-07-28 23:09:34 +05:30
|
|
|
config.include FastRailsRoot
|
2018-10-15 14:42:47 +05:30
|
|
|
end
|