2018-11-20 20:47:30 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
Encoding.default_external = 'UTF-8'
|
|
|
|
|
2022-03-02 08:16:31 +05:30
|
|
|
require_relative '../lib/gitlab_edition'
|
2019-12-21 20:55:43 +05:30
|
|
|
require_relative '../lib/gitlab/utils'
|
2019-10-12 21:52:04 +05:30
|
|
|
require_relative '../config/initializers/0_inject_enterprise_edition_module'
|
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
require_relative 'lib/gitlab'
|
|
|
|
|
2021-11-11 11:23:49 +05:30
|
|
|
require_relative '../config/bundler_setup'
|
|
|
|
Bundler.require(:default)
|
2021-06-08 01:23:25 +05:30
|
|
|
|
2022-05-07 20:08:51 +05:30
|
|
|
require 'securerandom'
|
|
|
|
require 'pathname'
|
2023-03-04 22:38:38 +05:30
|
|
|
require 'rainbow/refinement'
|
2022-05-07 20:08:51 +05:30
|
|
|
require 'active_support/core_ext/hash'
|
|
|
|
require 'active_support/core_ext/object/blank'
|
2023-03-04 22:38:38 +05:30
|
|
|
require 'active_support/core_ext/module/delegation'
|
2022-05-07 20:08:51 +05:30
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
module QA
|
2021-11-11 11:23:49 +05:30
|
|
|
root = "#{__dir__}/qa"
|
|
|
|
|
|
|
|
loader = Zeitwerk::Loader.new
|
2022-08-13 15:12:31 +05:30
|
|
|
|
|
|
|
# require jh/qa/qa.rb first, to load JH module make prepend module works
|
|
|
|
require '../jh/qa/qa' if GitlabEdition.jh?
|
|
|
|
|
2021-11-11 11:23:49 +05:30
|
|
|
loader.push_dir(root, namespace: QA)
|
|
|
|
|
|
|
|
loader.ignore("#{root}/specs/features")
|
2022-07-16 23:28:13 +05:30
|
|
|
loader.ignore("#{root}/specs/spec_helper.rb")
|
2021-11-11 11:23:49 +05:30
|
|
|
|
2022-11-25 23:54:43 +05:30
|
|
|
# we need to eager load scenario classes
|
|
|
|
# zeitwerk does not have option to configure what to eager load, so all exceptions have to be defined
|
|
|
|
loader.do_not_eager_load("#{root}/ce")
|
|
|
|
loader.do_not_eager_load("#{root}/ee")
|
|
|
|
loader.do_not_eager_load("#{root}/flow")
|
|
|
|
loader.do_not_eager_load("#{root}/git")
|
|
|
|
loader.do_not_eager_load("#{root}/mobile")
|
|
|
|
loader.do_not_eager_load("#{root}/page")
|
|
|
|
loader.do_not_eager_load("#{root}/resource")
|
|
|
|
loader.do_not_eager_load("#{root}/runtime")
|
|
|
|
loader.do_not_eager_load("#{root}/service")
|
|
|
|
loader.do_not_eager_load("#{root}/specs")
|
|
|
|
loader.do_not_eager_load("#{root}/support")
|
|
|
|
loader.do_not_eager_load("#{root}/tools")
|
|
|
|
loader.do_not_eager_load("#{root}/vendor")
|
|
|
|
|
2021-11-11 11:23:49 +05:30
|
|
|
loader.inflector.inflect(
|
|
|
|
"ce" => "CE",
|
|
|
|
"ee" => "EE",
|
|
|
|
"api" => "API",
|
|
|
|
"ssh" => "SSH",
|
|
|
|
"ssh_key" => "SSHKey",
|
|
|
|
"ssh_keys" => "SSHKeys",
|
|
|
|
"ecdsa" => "ECDSA",
|
|
|
|
"ed25519" => "ED25519",
|
|
|
|
"rsa" => "RSA",
|
|
|
|
"ldap" => "LDAP",
|
|
|
|
"ldap_tls" => "LDAPTLS",
|
|
|
|
"ldap_no_tls" => "LDAPNoTLS",
|
|
|
|
"ldap_no_server" => "LDAPNoServer",
|
|
|
|
"rspec" => "RSpec",
|
|
|
|
"web_ide" => "WebIDE",
|
|
|
|
"ci_cd" => "CiCd",
|
|
|
|
"project_imported_from_url" => "ProjectImportedFromURL",
|
|
|
|
"repo_by_url" => "RepoByURL",
|
|
|
|
"oauth" => "OAuth",
|
|
|
|
"saml_sso_sign_in" => "SamlSSOSignIn",
|
|
|
|
"group_saml" => "GroupSAML",
|
|
|
|
"instance_saml" => "InstanceSAML",
|
|
|
|
"saml_sso" => "SamlSSO",
|
|
|
|
"ldap_sync" => "LDAPSync",
|
|
|
|
"ip_address" => "IPAddress",
|
|
|
|
"gpg" => "GPG",
|
|
|
|
"user_gpg" => "UserGPG",
|
|
|
|
"smtp" => "SMTP",
|
|
|
|
"otp" => "OTP",
|
2021-12-11 22:18:48 +05:30
|
|
|
"jira_api" => "JiraAPI",
|
2022-04-04 11:22:00 +05:30
|
|
|
"registry_tls" => "RegistryTLS",
|
|
|
|
"jetbrains" => "JetBrains",
|
2022-05-07 20:08:51 +05:30
|
|
|
"vscode" => "VSCode",
|
2022-08-27 11:52:29 +05:30
|
|
|
"registry_with_cdn" => "RegistryWithCDN",
|
|
|
|
"fips" => "FIPS"
|
2021-11-11 11:23:49 +05:30
|
|
|
)
|
|
|
|
|
|
|
|
loader.setup
|
2022-11-25 23:54:43 +05:30
|
|
|
loader.eager_load
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
2022-08-27 11:52:29 +05:30
|
|
|
|
|
|
|
# Custom warning processing
|
|
|
|
Warning.process do |warning|
|
|
|
|
QA::Runtime::Logger.warn(warning.strip)
|
|
|
|
end
|
|
|
|
|
|
|
|
Warning.ignore(/already initialized constant Chemlab::Vendor|previous definition of Vendor was here/)
|