Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-06-05 21:09:44 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-06-05 21:09:44 +0300
commit2f1a81fd16ff9968d6b986f8a407d963bc2218f9 (patch)
treed079c1abc2bc282e749a676651c0f02d288874f3 /spec/support
parent18e9429b63f9a095b1ba3606856537b9ca291eac (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/capybara.rb6
-rw-r--r--spec/support/helpers/login_helpers.rb10
-rw-r--r--spec/support/shared_contexts/graphql/types/query_type_shared_context.rb3
-rw-r--r--spec/support/stub_dot_com_check.rb2
4 files changed, 14 insertions, 7 deletions
diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb
index e600cbd7004..c7b2a03fde2 100644
--- a/spec/support/capybara.rb
+++ b/spec/support/capybara.rb
@@ -53,7 +53,11 @@ Capybara.register_server :puma_via_workhorse do |app, port, host, **options|
# In cases of multiple installations of chromedriver, prioritize the version installed by SeleniumManager
# selenium-manager doesn't work with Linux arm64 yet:
# https://github.com/SeleniumHQ/selenium/issues/11357
- if RUBY_PLATFORM =~ /x86_64-linux|darwin/
+ if RUBY_PLATFORM.include?('x86_64-linux') ||
+ # Rosetta is required on macOS because the selenium-manager
+ # binaries (https://github.com/SeleniumHQ/selenium/tree/trunk/common/manager/macos)
+ # are only compiled for macOS x86.
+ (RUBY_PLATFORM.include?('darwin') && system('/usr/bin/pgrep -q oahd'))
chrome_options = Selenium::WebDriver::Chrome::Options.chrome
chromedriver_path = File.dirname(Selenium::WebDriver::SeleniumManager.driver_path(chrome_options))
ENV['PATH'] = "#{chromedriver_path}:#{ENV['PATH']}" # rubocop:disable RSpec/EnvAssignment
diff --git a/spec/support/helpers/login_helpers.rb b/spec/support/helpers/login_helpers.rb
index 67315b9d81e..acd654bc96d 100644
--- a/spec/support/helpers/login_helpers.rb
+++ b/spec/support/helpers/login_helpers.rb
@@ -149,7 +149,7 @@ module LoginHelpers
mock_auth_hash(provider, uid, email, response_object: response_object)
end
- def configure_mock_auth(provider, uid, email, response_object: nil, additional_info: {})
+ def configure_mock_auth(provider, uid, email, response_object: nil, additional_info: {}, name: 'mockuser')
# The mock_auth configuration allows you to set per-provider (or default)
# authentication hashes to return during integration testing.
@@ -157,7 +157,7 @@ module LoginHelpers
provider: provider,
uid: uid,
info: {
- name: 'mockuser',
+ name: name,
email: email,
image: 'mock_user_thumbnail_url'
},
@@ -180,8 +180,10 @@ module LoginHelpers
}).merge(additional_info) { |_, old_hash, new_hash| old_hash.merge(new_hash) }
end
- def mock_auth_hash(provider, uid, email, additional_info: {}, response_object: nil)
- configure_mock_auth(provider, uid, email, additional_info: additional_info, response_object: response_object)
+ def mock_auth_hash(provider, uid, email, additional_info: {}, response_object: nil, name: 'mockuser')
+ configure_mock_auth(
+ provider, uid, email, additional_info: additional_info, response_object: response_object, name: name
+ )
original_env_config_omniauth_auth = Rails.application.env_config['omniauth.auth']
Rails.application.env_config['omniauth.auth'] = OmniAuth.config.mock_auth[provider.to_sym]
diff --git a/spec/support/shared_contexts/graphql/types/query_type_shared_context.rb b/spec/support/shared_contexts/graphql/types/query_type_shared_context.rb
index 095c8639d15..26f550b9b40 100644
--- a/spec/support/shared_contexts/graphql/types/query_type_shared_context.rb
+++ b/spec/support/shared_contexts/graphql/types/query_type_shared_context.rb
@@ -40,7 +40,8 @@ RSpec.shared_context 'with FOSS query type fields' do
:usage_trends_measurements,
:user,
:users,
- :work_item
+ :work_item,
+ :audit_event_definitions
]
end
end
diff --git a/spec/support/stub_dot_com_check.rb b/spec/support/stub_dot_com_check.rb
index 8134e15cb12..6934b33d111 100644
--- a/spec/support/stub_dot_com_check.rb
+++ b/spec/support/stub_dot_com_check.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
RSpec.configure do |config|
- %i[saas saas_registration saas_sso_registration saas_subscription_registration].each do |metadata|
+ %i[saas saas_registration].each do |metadata|
config.before(:context, metadata) do
# Ensure Gitlab.com? returns true during context.
# This is needed for let_it_be which is shared across examples,