diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /spec/support/rspec.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'spec/support/rspec.rb')
-rw-r--r-- | spec/support/rspec.rb | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/spec/support/rspec.rb b/spec/support/rspec.rb index 30e48b3baf1..6795d2f6d2a 100644 --- a/spec/support/rspec.rb +++ b/spec/support/rspec.rb @@ -1,22 +1,26 @@ # frozen_string_literal: true +require_relative "rspec_order" +require_relative "system_exit_detected" require_relative "helpers/stub_configuration" require_relative "helpers/stub_metrics" require_relative "helpers/stub_object_storage" require_relative "helpers/stub_env" require_relative "helpers/fast_rails_root" -# so we need to load rubocop here due to the rubocop support file loading cop_helper -# which monkey patches class Cop -# if cop helper is loaded before rubocop (where class Cop is defined as class Cop < Base) -# we get a `superclass mismatch for class Cop` error when running a rspec for a locally defined -# rubocop cop - therefore we need rubocop required first since it had an inheritance added to the Cop class -require 'rubocop' -require 'rubocop/rspec/support' - RSpec::Expectations.configuration.on_potential_false_positives = :raise RSpec.configure do |config| + # 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 + config.mock_with :rspec do |mocks| mocks.verify_doubled_constant_names = true end @@ -28,10 +32,4 @@ RSpec.configure do |config| config.include StubObjectStorage config.include StubENV config.include FastRailsRoot - - config.include RuboCop::RSpec::ExpectOffense, type: :rubocop - - config.define_derived_metadata(file_path: %r{spec/rubocop}) do |metadata| - metadata[:type] = :rubocop - end end |