From 48aff82709769b098321c738f3444b9bdaa694c6 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 21 Oct 2020 07:08:36 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-5-stable-ee --- spec/spec_helper.rb | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'spec/spec_helper.rb') diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 11a83bd9501..11a45e005b8 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -66,7 +66,11 @@ RSpec.configure do |config| config.display_try_failure_messages = true config.infer_spec_type_from_file_location! - config.full_backtrace = !!ENV['CI'] + + # Add :full_backtrace tag to an example if full_backtrace output is desired + config.before(:each, full_backtrace: true) do |example| + config.full_backtrace = true + end unless ENV['CI'] # Re-run failures locally with `--only-failures` @@ -124,6 +128,7 @@ RSpec.configure do |config| config.include LoginHelpers, type: :feature config.include SearchHelpers, type: :feature config.include WaitHelpers, type: :feature + config.include WaitForRequests, type: :feature config.include EmailHelpers, :mailer, type: :mailer config.include Warden::Test::Helpers, type: :request config.include Gitlab::Routing, type: :routing @@ -133,7 +138,6 @@ RSpec.configure do |config| config.include InputHelper, :js config.include SelectionHelper, :js config.include InspectRequests, :js - config.include WaitForRequests, :js config.include LiveDebugger, :js config.include MigrationsHelpers, :migration config.include RedisHelpers @@ -208,6 +212,10 @@ RSpec.configure do |config| # for now whilst we migrate as much as we can over the GraphQL stub_feature_flags(merge_request_widget_graphql: false) + # Using FortiAuthenticator as OTP provider is disabled by default in + # tests, until we introduce it in user settings + stub_feature_flags(forti_authenticator: false) + enable_rugged = example.metadata[:enable_rugged].present? # Disable Rugged features by default @@ -225,7 +233,7 @@ RSpec.configure do |config| end # Enable Marginalia feature for all specs in the test suite. - allow(Gitlab::Marginalia).to receive(:cached_feature_enabled?).and_return(true) + Gitlab::Marginalia.enabled = true # Stub these calls due to being expensive operations # It can be reenabled for specific tests via: @@ -233,6 +241,12 @@ RSpec.configure do |config| # expect(Gitlab::Git::KeepAround).to receive(:execute).and_call_original allow(Gitlab::Git::KeepAround).to receive(:execute) + # Stub these calls due to being expensive operations + # It can be reenabled for specific tests via: + # + # expect(Gitlab::JobWaiter).to receive(:wait).and_call_original + allow_any_instance_of(Gitlab::JobWaiter).to receive(:wait) + Gitlab::ProcessMemoryCache.cache_backend.clear Sidekiq::Worker.clear_all -- cgit v1.2.3