Commit 056ad1c8 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents 9be5ae87 4e503205
......@@ -315,9 +315,9 @@ fieldset:disabled a.btn {
-moz-appearance: none;
}
.gl-form-input:disabled,
.gl-form-input:not(.form-control-plaintext):read-only,
.gl-form-input:not(.form-control-plaintext):not([type="color"]):read-only,
.gl-form-input.form-control:disabled,
.gl-form-input.form-control:not(.form-control-plaintext):read-only {
.gl-form-input.form-control:not(.form-control-plaintext):not([type="color"]):read-only {
background-color: #fafafa;
color: #868686;
box-shadow: inset 0 0 0 1px #dbdbdb;
......
......@@ -8,6 +8,12 @@ info: To determine the technical writer assigned to the Stage/Group associated w
This is a tailored extension of the Best Practices [found in the testing guide](../best_practices.md).
## Class and module naming
The QA framework uses [Zeitwerk](https://github.com/fxn/zeitwerk) for class and module autoloading. The default Zeitwerk [inflector](https://github.com/fxn/zeitwerk#zeitwerkinflector) simply converts snake_cased file names to PascalCased module or class names. It is advised to stick to this pattern to avoid manual maintenance of inflections.
In case custom inflection logic is needed, custom inflectors are added in the [qa.rb](https://gitlab.com/gitlab-org/gitlab/-/blob/master/qa/qa.rb) file in the `loader.inflector.inflect` method invocation.
## Link a test to its test-case issue
Every test should have a corresponding issue in the [Quality Test Cases project](https://gitlab.com/gitlab-org/quality/testcases/).
......@@ -342,7 +348,7 @@ end
When something requires waiting to be matched, use `eventually_` matchers with clear wait duration definition.
`Eventually` matchers use the following naming pattern: `eventually_${rspec_matcher_name}`. They are defined in [eventually_matcher.rb](https://gitlab.com/gitlab-org/gitlab/-/blob/master/qa/spec/support/matchers/eventually_matcher.rb).
`Eventually` matchers use the following naming pattern: `eventually_${rspec_matcher_name}`. They are defined in [eventually_matcher.rb](https://gitlab.com/gitlab-org/gitlab/-/blob/master/qa/qa/support/matchers/eventually_matcher.rb).
```ruby
expect { async_value }.to eventually_eq(value).within(max_duration: 120, max_attempts: 60, reload_page: page)
......
......@@ -315,9 +315,9 @@ fieldset:disabled a.btn {
-moz-appearance: none;
}
.gl-form-input:disabled,
.gl-form-input:not(.form-control-plaintext):read-only,
.gl-form-input:not(.form-control-plaintext):not([type="color"]):read-only,
.gl-form-input.form-control:disabled,
.gl-form-input.form-control:not(.form-control-plaintext):read-only {
.gl-form-input.form-control:not(.form-control-plaintext):not([type="color"]):read-only {
background-color: #fafafa;
color: #868686;
box-shadow: inset 0 0 0 1px #dbdbdb;
......
......@@ -35,10 +35,9 @@ module API
not_found!('Commit') unless @commit
@repo = user_project.repository
@blob = @repo.blob_at(@commit.sha, params[:file_path])
@blob = @repo.blob_at(@commit.sha, params[:file_path], limit: Gitlab::Git::Blob::LFS_POINTER_MAX_SIZE)
not_found!('File') unless @blob
@blob.load_all_data!
end
def commit_response(attrs)
......@@ -48,13 +47,21 @@ module API
}
end
def content_sha
Rails.cache.fetch("blob_content_sha256:#{user_project.full_path}:#{@blob.id}") do
@blob.load_all_data!
Digest::SHA256.hexdigest(@blob.data)
end
end
def blob_data
{
file_name: @blob.name,
file_path: @blob.path,
size: @blob.size,
encoding: "base64",
content_sha256: Digest::SHA256.hexdigest(@blob.data),
content_sha256: content_sha,
ref: params[:ref],
blob_id: @blob.id,
commit_id: @commit.id,
......@@ -154,6 +161,8 @@ module API
get ":id/repository/files/:file_path", requirements: FILE_ENDPOINT_REQUIREMENTS do
assign_file_vars!
@blob.load_all_data!
data = blob_data
set_http_headers(data)
......
......@@ -2,7 +2,7 @@
source 'https://rubygems.org'
gem 'gitlab-qa'
gem 'gitlab-qa', require: 'gitlab/qa'
gem 'activesupport', '~> 6.1.3.2' # This should stay in sync with the root's Gemfile
gem 'allure-rspec', '~> 2.14.1'
gem 'capybara', '~> 3.35.0'
......@@ -10,10 +10,9 @@ gem 'capybara-screenshot', '~> 1.0.23'
gem 'rake', '~> 12.3.3'
gem 'rspec', '~> 3.10'
gem 'selenium-webdriver', '~> 4.0.0.beta4'
gem 'airborne', '~> 0.3.4'
gem 'airborne', '~> 0.3.4', require: false # airborne is messing with rspec sandboxed mode so not requiring by default
gem 'rest-client', '~> 2.1.0'
gem 'nokogiri', '~> 1.11.7'
gem 'rspec-retry', '~> 0.6.1'
gem 'rspec-retry', '~> 0.6.1', require: 'rspec/retry'
gem 'rspec_junit_formatter', '~> 0.4.1'
gem 'faker', '~> 1.6', '>= 1.6.6'
gem 'knapsack', '~> 1.17'
......@@ -24,6 +23,7 @@ gem 'parallel', '~> 1.19'
gem 'rspec-parameterized', '~> 0.4.2'
gem 'octokit', '~> 4.21'
gem 'webdrivers', '~> 4.6'
gem 'zeitwerk', '~> 2.4'
gem 'chemlab', '~> 0.7'
gem 'chemlab-library-www-gitlab-com', '~> 0.1'
......
......@@ -221,7 +221,6 @@ DEPENDENCIES
faker (~> 1.6, >= 1.6.6)
gitlab-qa
knapsack (~> 1.17)
nokogiri (~> 1.11.7)
octokit (~> 4.21)
parallel (~> 1.19)
parallel_tests (~> 2.29)
......@@ -237,6 +236,7 @@ DEPENDENCIES
selenium-webdriver (~> 4.0.0.beta4)
timecop (~> 0.9.1)
webdrivers (~> 4.6)
zeitwerk (~> 2.4)
BUNDLED WITH
2.2.22
This diff is collapsed.
......@@ -5,10 +5,6 @@ module QA
module Strategy
extend self
def extend_autoloads!
# noop
end
def perform_before_hooks
# The login page could take some time to load the first time it is visited.
# We visit the login page and wait for it to properly load only once before the tests.
......
# frozen_string_literal: true
module QA
##
# GitLab EE extensions
#
module EE
module Runtime
autoload :Env, 'qa/ee/runtime/env'
autoload :Geo, 'qa/ee/runtime/geo'
autoload :Saml, 'qa/ee/runtime/saml'
end
module Page
autoload :OperationsDashboard, 'qa/ee/page/operations_dashboard'
module Component
autoload :LicenseManagement, 'qa/ee/page/component/license_management'
autoload :SecureReport, 'qa/ee/page/component/secure_report'
module IssueBoard
autoload :Show, 'qa/ee/page/component/issue_board/show'
end
module WebIDE
autoload :WebTerminalPanel, 'qa/ee/page/component/web_ide/web_terminal_panel'
end
end
module Dashboard
autoload :Projects, 'qa/ee/page/dashboard/projects'
end
module Group
autoload :Menu, 'qa/ee/page/group/menu'
autoload :SamlSSOSignIn, 'qa/ee/page/group/saml_sso_sign_in'
autoload :SamlSSOSignUp, 'qa/ee/page/group/saml_sso_sign_up'
autoload :Members, 'qa/ee/page/group/members'
autoload :ContributionAnalytics, 'qa/ee/page/group/contribution_analytics'
module Iteration
autoload :Index, 'qa/ee/page/group/iteration/index'
autoload :New, 'qa/ee/page/group/iteration/new'
autoload :Show, 'qa/ee/page/group/iteration/show'
end
module Settings
autoload :SamlSSO, 'qa/ee/page/group/settings/saml_sso'
autoload :LDAPSync, 'qa/ee/page/group/settings/ldap_sync'
autoload :General, 'qa/ee/page/group/settings/general'
end
module Wiki
autoload :Show, 'qa/ee/page/group/wiki/show'
autoload :Edit, 'qa/ee/page/group/wiki/edit'
end
end
module File
autoload :Show, 'qa/ee/page/file/show'
end
module Main
autoload :Banner, 'qa/ee/page/main/banner'
end
module Registration
autoload :Welcome, 'qa/ee/page/registration/welcome'
end
module Admin
autoload :Menu, 'qa/ee/page/admin/menu'
autoload :License, 'qa/ee/page/admin/license'
module Geo
module Nodes
autoload :Show, 'qa/ee/page/admin/geo/nodes/show'
autoload :New, 'qa/ee/page/admin/geo/nodes/new'
end
end
module Monitoring
autoload :AuditLog, 'qa/ee/page/admin/monitoring/audit_log.rb'
end
module Settings
autoload :Templates, 'qa/ee/page/admin/settings/templates'
autoload :Preferences, 'qa/ee/page/admin/settings/preferences'
module Component
autoload :Email, 'qa/ee/page/admin/settings/component/email'
autoload :Elasticsearch, 'qa/ee/page/admin/settings/component/elasticsearch'
end
end
module Overview
module Groups
autoload :Edit, 'qa/ee/page/admin/overview/groups/edit'
end
end
end
module Milestone
autoload :Show, 'qa/ee/page/milestone/show'
end
module Profile
autoload :Menu, 'qa/ee/page/profile/menu'
end
module Project
autoload :New, 'qa/ee/page/project/new'
autoload :Show, 'qa/ee/page/project/show'
autoload :Menu, 'qa/ee/page/project/menu'
module SubMenus
autoload :SecurityCompliance, 'qa/ee/page/project/sub_menus/security_compliance'
autoload :Repository, 'qa/ee/page/project/sub_menus/repository'
autoload :Settings, 'qa/ee/page/project/sub_menus/settings'
autoload :Analytics, 'qa/ee/page/project/sub_menus/analytics'
autoload :LicenseCompliance, 'qa/ee/page/project/sub_menus/license_compliance'
end
module Issue
autoload :Index, 'qa/ee/page/project/issue/index'
autoload :Show, 'qa/ee/page/project/issue/show'
end
module Wiki
autoload :Show, 'qa/ee/page/project/wiki/show'
end
module Settings
autoload :ProtectedBranches, 'qa/ee/page/project/settings/protected_branches'
autoload :Main, 'qa/ee/page/project/settings/main'
autoload :MirroringRepositories, 'qa/ee/page/project/settings/mirroring_repositories'
autoload :ProtectedTags, 'qa/ee/page/project/settings/protected_tags'
autoload :MergeRequest, 'qa/ee/page/project/settings/merge_request'
autoload :MergeRequestApprovals, 'qa/ee/page/project/settings/merge_request_approvals'
autoload :Integrations, 'qa/ee/page/project/settings/integrations'
autoload :Repository, 'qa/ee/page/project/settings/repository'
autoload :PushRules, 'qa/ee/page/project/settings/push_rules'
autoload :IssueTemplateDefault, 'qa/ee/page/project/settings/issue_template_default.rb'
autoload :CICD, 'qa/ee/page/project/settings/ci_cd'
autoload :PipelineSubscriptions, 'qa/ee/page/project/settings/pipeline_subscriptions'
end
module Monitor
module Metrics
autoload :Show, 'qa/ee/page/project/monitor/metrics/show'
end
end
module Pipeline
autoload :Show, 'qa/ee/page/project/pipeline/show'
autoload :Index, 'qa/ee/page/project/pipeline/index'
end
module Secure
autoload :Show, 'qa/ee/page/project/secure/show'
autoload :DependencyList, 'qa/ee/page/project/secure/dependency_list'
autoload :SecurityDashboard, 'qa/ee/page/project/secure/security_dashboard'
autoload :VulnerabilityDetails, 'qa/ee/page/project/secure/vulnerability_details'
autoload :LicenseCompliance, 'qa/ee/page/project/secure/license_compliance'
autoload :ConfigurationForm, 'qa/ee/page/project/secure/configuration_form'
end
module PathLocks
autoload :Index, 'qa/ee/page/project/path_locks/index'
end
module Packages
autoload :Index, 'qa/ee/page/project/packages/index'
end
module Snippet
autoload :Index, 'qa/ee/page/project/snippet/index'
end
module Job
autoload :Show, 'qa/ee/page/project/job/show'
end
module ThreatMonitoring
autoload :Index, 'qa/ee/page/project/threat_monitoring/index'
autoload :AlertsList, 'qa/ee/page/project/threat_monitoring/alerts_list'
end
end
module MergeRequest
autoload :New, 'qa/ee/page/merge_request/new'
autoload :Show, 'qa/ee/page/merge_request/show'
end
module Group
autoload :IssuesAnalytics, 'qa/ee/page/group/issues_analytics'
autoload :Roadmap, 'qa/ee/page/group/roadmap'
module Epic
autoload :Index, 'qa/ee/page/group/epic/index'
autoload :New, 'qa/ee/page/group/epic/new'
autoload :Show, 'qa/ee/page/group/epic/show'
end
module Secure
autoload :Show, 'qa/ee/page/group/secure/show'
end
end
module Insights
autoload :Show, 'qa/ee/page/insights/show'
end
end
module Resource
autoload :License, 'qa/ee/resource/license'
autoload :Epic, 'qa/ee/resource/epic'
autoload :GroupIteration, 'qa/ee/resource/group_iteration'
autoload :ImportRepoWithCiCd, 'qa/ee/resource/import_repo_with_ci_cd'
autoload :PipelineSubscriptions, 'qa/ee/resource/pipeline_subscriptions'
autoload :GroupBase, 'qa/ee/resource/group_base'
module Board
autoload :BaseBoard, 'qa/ee/resource/board/base_board'
autoload :GroupBoard, 'qa/ee/resource/board/group_board'
autoload :ProjectBoard, 'qa/ee/resource/board/project_board'
module BoardList
module Group
autoload :BoardList, 'qa/ee/resource/board/board_list/group/board_list'
end
module Project
autoload :BaseBoardList, 'qa/ee/resource/board/board_list/project/base_board_list'
autoload :AssigneeBoardList, 'qa/ee/resource/board/board_list/project/assignee_board_list'
autoload :LabelBoardList, 'qa/ee/resource/board/board_list/project/label_board_list'
autoload :MilestoneBoardList, 'qa/ee/resource/board/board_list/project/milestone_board_list'
end
end
end
module Geo
autoload :Node, 'qa/ee/resource/geo/node'
end
module Settings
autoload :Elasticsearch, 'qa/ee/resource/settings/elasticsearch'
end
end
module Scenario
module Test
autoload :Geo, 'qa/ee/scenario/test/geo'
module Integration
autoload :GroupSAML, 'qa/ee/scenario/test/integration/group_saml'
autoload :Elasticsearch, 'qa/ee/scenario/test/integration/elasticsearch'
end
module Sanity
autoload :Selectors, 'qa/ee/scenario/test/sanity/selectors'
end
end
end
end
end
......@@ -5,7 +5,7 @@ module QA
module Page
module Project
module Settings
module CICD
module CiCd
extend QA::Page::PageConcern
def self.prepended(base)
......
......@@ -9,7 +9,7 @@ module QA
def fabricate!
QA::Page::Project::Menu.perform(&:go_to_ci_cd_settings)
QA::Page::Project::Settings::CICD.perform do |setting|
QA::Page::Project::Settings::CiCd.perform do |setting|
setting.expand_pipeline_subscriptions do |page|
page.subscribe(project_path)
end
......
......@@ -5,11 +5,6 @@ module QA
module Strategy
extend self
def extend_autoloads!
require 'qa/ce/strategy'
require 'qa/ee'
end
def perform_before_hooks
# Without a license, perform the CE before hooks only.
unless ENV['EE_LICENSE']
......
......@@ -67,7 +67,7 @@ module QA
end
def login_to_idp_if_required(username, password)
Vendor::SAMLIdp::Page::Login.perform { |login_page| login_page.login_if_required(username, password) }
Vendor::SamlIdp::Page::Login.perform { |login_page| login_page.login_if_required(username, password) }
end
end
end
......
......@@ -4,7 +4,6 @@ require 'cgi'
require 'uri'
require 'fileutils'
require 'tmpdir'
require 'securerandom'
module QA
module Git
......
# frozen_string_literal: true
require 'securerandom'
module QA
module Page
module Project
......
......@@ -4,7 +4,7 @@ module QA
module Page
module Project
module Settings
class CICD < Page::Base
class CiCd < Page::Base
include QA::Page::Settings::Common
view 'app/views/projects/settings/ci_cd/show.html.haml' do
......@@ -43,4 +43,4 @@ module QA
end
end
QA::Page::Project::Settings::CICD.prepend_mod_with("Page::Project::Settings::CICD", namespace: QA)
QA::Page::Project::Settings::CiCd.prepend_mod_with("Page::Project::Settings::CiCd", namespace: QA)
# frozen_string_literal: true
require 'pathname'
module QA
module Page
class View
......
......@@ -55,7 +55,7 @@ module QA
end
end
include Support::Api
include Support::API
attr_writer :api_resource, :api_response
def api_put(body = api_put_body)
......
......@@ -22,7 +22,7 @@ module QA
Page::Project::Menu.perform(&:go_to_ci_cd_settings)
Page::Project::Settings::CICD.perform do |setting|
Page::Project::Settings::CiCd.perform do |setting|
setting.expand_ci_variables do |page|
page.click_add_variable
page.fill_variable(key, value, masked)
......
# frozen_string_literal: true
require 'securerandom'
module QA
module Resource
class Issue < Base
......
# frozen_string_literal: true
require 'securerandom'
module QA
module Resource
module KubernetesCluster
......
# frozen_string_literal: true
require 'securerandom'
module QA
module Resource
# Base label class for GroupLabel and ProjectLabel
......
......@@ -12,7 +12,7 @@ module QA
QA::Runtime::Logger.debug(%Q[Adding user #{user.username} to #{full_path} #{self.class.name}])
response = post Runtime::API::Request.new(api_client, api_members_path).url, { user_id: user.id, access_level: access_level }
response.code == QA::Support::Api::HTTP_STATUS_CREATED
response.code == QA::Support::API::HTTP_STATUS_CREATED
end
end
......@@ -31,7 +31,7 @@ module QA
QA::Runtime::Logger.debug(%Q[Sharing #{self.class.name} with #{group.name}])
response = post Runtime::API::Request.new(api_client, api_share_path).url, { group_id: group.id, group_access: access_level }
response.code == QA::Support::Api::HTTP_STATUS_CREATED
response.code == QA::Support::API::HTTP_STATUS_CREATED
end
end
......
# frozen_string_literal: true
require 'securerandom'
module QA
module Resource
class MergeRequest < Base
......
# frozen_string_literal: true
require 'securerandom'
module QA
module Resource
class MergeRequestFromFork < MergeRequest
......
# frozen_string_literal: true
require 'securerandom'
module QA
module Resource
class Package < Base
......
# frozen_string_literal: true
require 'securerandom'
module QA
module Resource
class Project < Base
......
# frozen_string_literal: true
require 'octokit'
module QA
module Resource
class ProjectImportedFromGithub < Resource::Project
......@@ -68,7 +66,7 @@ module QA
response = post(request_url(api_trigger_mirror_pull_path), nil)
Runtime::Logger.info "Mirror pull request response: #{response}"
response.code == Support::Api::HTTP_STATUS_OK
response.code == Support::API::HTTP_STATUS_OK
end
end
......
# frozen_string_literal: true
require 'securerandom'
module QA
module Resource
class ProjectImportedFromURL < Resource::Project
......
# frozen_string_literal: true
require 'securerandom'
module QA
module Resource
class ProjectIssueNote < Base
......
# frozen_string_literal: true
require 'securerandom'
module QA
module Resource
class ProtectedBranch < Base
......
# frozen_string_literal: true
require 'securerandom'
module QA
module Resource
class RegistryRepository < Base
......
# frozen_string_literal: true
require 'securerandom'
module QA
module Resource
module Repository
......
# frozen_string_literal: true
require 'pathname'
require 'securerandom'
module QA
module Resource
module Repository
......
# frozen_string_literal: true
require 'securerandom'
module QA
module Resource
class Runner < Base
......
......@@ -72,7 +72,7 @@ module QA
Support::Retrier.retry_until(max_duration: QA::EE::Runtime::Geo.max_db_replication_time, sleep_interval: 3) do
response = get Runtime::API::Request.new(api_client, api_get_path).url
response.code == QA::Support::Api::HTTP_STATUS_OK &&
response.code == QA::Support::API::HTTP_STATUS_OK &&
parse_body(response)[:title].include?(title)
end
end
......
# frozen_string_literal: true
require 'securerandom'
module QA
module Resource
class User < Base
......
# frozen_string_literal: true
require 'securerandom'
module QA
module Resource
module Wiki
......
......@@ -12,8 +12,6 @@ module QA
def configure!
return unless Env.generate_allure_report?
require 'allure-rspec'
configure_allure
configure_attachments
configure_rspec
......
......@@ -5,7 +5,7 @@ module QA
module API
module RepositoryStorageMoves
extend self
extend Support::Api
extend Support::API
RepositoryStorageMovesError = Class.new(RuntimeError)
......
......@@ -4,7 +4,7 @@ module QA
module Runtime
class ApplicationSettings
class << self
include Support::Api
include Support::API
APPLICATION_SETTINGS_PATH = '/application/settings'
......@@ -18,7 +18,7 @@ module QA
QA::Runtime::Logger.info("Setting application settings: #{application_settings}")
r = put(Runtime::API::Request.new(api_client, APPLICATION_SETTINGS_PATH).url, **application_settings)
raise "Couldn't set application settings #{application_settings.inspect}" unless r.code == QA::Support::Api::HTTP_STATUS_OK
raise "Couldn't set application settings #{application_settings.inspect}" unless r.code == QA::Support::API::HTTP_STATUS_OK
end
def get_application_settings
......
......@@ -4,7 +4,6 @@ require 'rspec/core'
require 'rspec/expectations'
require 'capybara/rspec'
require 'capybara-screenshot/rspec'
require 'selenium-webdriver'
require 'webdrivers/chromedriver'
require 'webdrivers/geckodriver'
......
# frozen_string_literal: true
require 'active_support/deprecation'
require 'gitlab/qa'
require 'uri'
module QA
......
......@@ -8,7 +8,7 @@ module QA
class << self
# Documentation: https://docs.gitlab.com/ee/api/features.html
include Support::Api
include Support::API
SetFeatureError = Class.new(RuntimeError)
AuthorizationError = Class.new(RuntimeError)
......@@ -17,7 +17,7 @@ module QA
def remove(key)
request = Runtime::API::Request.new(api_client, "/features/#{key}")
response = delete(request.url)
unless response.code == QA::Support::Api::HTTP_STATUS_NO_CONTENT
unless response.code == QA::Support::API::HTTP_STATUS_NO_CONTENT
raise SetFeatureError, "Deleting feature flag #{key} failed with `#{response}`."
end
end
......@@ -100,7 +100,7 @@ module QA
scopes[:user] = scopes[:user].username if scopes.key?(:user)
request = Runtime::API::Request.new(api_client, "/features/#{key}")
response = post(request.url, scopes.merge({ value: value }))
unless response.code == QA::Support::Api::HTTP_STATUS_CREATED
unless response.code == QA::Support::API::HTTP_STATUS_CREATED
raise SetFeatureError, "Setting feature flag #{key} to #{value} failed with `#{response}`."
end
end
......
......@@ -5,7 +5,7 @@ require 'tmpdir'
module QA
module Runtime
module Fixtures
include Support::Api
include Support::API
TemplateNotFoundError = Class.new(RuntimeError)
......
......@@ -4,7 +4,7 @@ require 'socket'
module QA
module Runtime
module IPAddress
include Support::Api
include Support::API
HostUnreachableError = Class.new(StandardError)
LOOPBACK_ADDRESS = '127.0.0.1'
......@@ -15,7 +15,7 @@ module QA
# we use the public facing IP address
ip_address = if Env.running_in_ci? && !URI.parse(Scenario.gitlab_address).host.include?('test')
response = get(PUBLIC_IP_ADDRESS_API)
raise HostUnreachableError, "#{PUBLIC_IP_ADDRESS_API} is unreachable" unless response.code == Support::Api::HTTP_STATUS_OK
raise HostUnreachableError, "#{PUBLIC_IP_ADDRESS_API} is unreachable" unless response.code == Support::API::HTTP_STATUS_OK
response.body
elsif page.current_host.include?('localhost')
......
......@@ -13,10 +13,6 @@ module QA
# CE to EE.
#
class Release
def initialize
require "qa/#{version.downcase}/strategy"
end
def version
@version ||= ::File.directory?("#{__dir__}/../ee") ? :EE : :CE
end
......
# frozen_string_literal: true
require 'securerandom'
module QA
module Runtime
module Search
extend self
extend Support::Api
extend Support::API
RETRY_MAX_ITERATION = 10
RETRY_SLEEP_INTERVAL = 12
......
# frozen_string_literal: true
require 'resolv'
require 'securerandom'
module QA
module Service
......
# frozen_string_literal: true
require 'securerandom'
require 'mkmf'
require 'pathname'
module QA
module Service
......
# frozen_string_literal: true
require 'octokit'
# rubocop:disable Rails/Pluck
module QA
# Only executes in custom job/pipeline
......
......@@ -4,7 +4,7 @@ require 'airborne'
module QA
RSpec.describe 'Plan' do
include Support::Api
include Support::API
describe 'Issue' do
let(:issue) do
......
# frozen_string_literal: true
require 'securerandom'
module QA
RSpec.describe 'Create' do
describe 'Default branch name instance setting', :requires_admin, :skip_live_env do
......
# frozen_string_literal: true
require 'airborne'
require 'securerandom'
module QA
RSpec.describe 'API basics' do
......
# frozen_string_literal: true
require 'airborne'
require 'securerandom'
require 'digest'
module QA
RSpec.describe 'Create' do
describe 'Compare archives of different user projects with the same name and check they\'re different' do
include Support::Api
include Support::API
let(:project_name) { "project-archive-download-#{SecureRandom.hex(8)}" }
let(:archive_types) { %w(tar.gz tar.bz2 tar zip) }
......
......@@ -4,7 +4,7 @@ require 'airborne'
module QA
RSpec.describe 'Package', only: { subdomain: %i[staging pre] } do
include Support::Api
include Support::API
describe 'Container Registry' do
let(:api_client) { Runtime::API::Client.new(:gitlab) }
......
......@@ -3,12 +3,15 @@
module QA
RSpec.describe 'Manage', :orchestrated, :instance_saml do
describe 'Instance wide SAML SSO' do
it 'user logs in to gitlab with SAML SSO', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/671' do
it(
'user logs in to gitlab with SAML SSO',
testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/671'
) do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_with_saml)
Vendor::SAMLIdp::Page::Login.perform do |login_page|
Vendor::SamlIdp::Page::Login.perform do |login_page|
login_page.login('user1', 'user1pass')
end
......
# frozen_string_literal: true
require 'nokogiri'
module QA
RSpec.describe 'Manage', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/212145', type: :stale } do
describe 'Check for broken images', :requires_admin do
......
......@@ -3,7 +3,7 @@
module QA
RSpec.describe 'Plan', :orchestrated, :smtp, :requires_admin do
describe 'Email Notification' do
include Support::Api
include Support::API
let!(:user) do
Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1)
......
# frozen_string_literal: true
require 'securerandom'
module QA
RSpec.describe 'Plan', :reliable do
describe 'Issues list' do
......
# frozen_string_literal: true
require 'securerandom'
module QA
RSpec.describe 'Create', :requires_admin, :skip_live_env, quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/195179', type: :flaky } do
......
......@@ -2,7 +2,7 @@
module QA
RSpec.describe 'Create' do
include Support::Api
include Support::API
describe 'Jira integration', :jira, :orchestrated, :requires_admin do
let(:jira_project_key) { 'JITP' }
......
# frozen_string_literal: true
require 'securerandom'
module QA
RSpec.describe 'Create' do
describe 'File templates' do
......
......@@ -9,7 +9,7 @@ module QA
# tests are run in parallel).
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/218620#note_361634705
include Support::Api
include Support::API
before(:context) do
@project = Resource::Project.fabricate_via_api! do |p|
......
# frozen_string_literal: true
require 'securerandom'
module QA
RSpec.describe 'Create' do
describe 'Web IDE file templates' do
......
# frozen_string_literal: true
require 'faker'
module QA
RSpec.describe 'Verify', :runner do
describe 'Pipeline with protected variable' do
......
# frozen_string_literal: true
require 'faker'
module QA
RSpec.describe 'Verify', :runner do
describe 'Include multiple files from a project' do
......
# frozen_string_literal: true
require 'faker'
module QA
RSpec.describe 'Verify', :runner do
context 'When pipeline is blocked' do
......
# frozen_string_literal: true
require 'faker'
module QA
RSpec.describe 'Verify', :runner do
context 'When job is configured to only run on merge_request_events' do
......
# frozen_string_literal: true
require 'faker'
module QA
RSpec.describe 'Verify', :runner do
describe 'Pass dotenv variables to downstream via bridge' do
......
# frozen_string_literal: true
require 'faker'
module QA
RSpec.describe 'Verify', :runner do
describe "Trigger child pipeline with 'when:manual'" do
......
# frozen_string_literal: true
require 'faker'
module QA
RSpec.describe 'Verify', :runner do
describe 'Trigger matrix' do
......
......@@ -21,7 +21,7 @@ module QA
runner.project.visit!
Page::Project::Menu.perform(&:go_to_ci_cd_settings)
Page::Project::Settings::CICD.perform do |settings|
Page::Project::Settings::CiCd.perform do |settings|
sleep 5 # Runner should register within 5 seconds
settings.expand_runners_settings do |page|
......
......@@ -49,7 +49,7 @@ module QA
def configure_code_coverage(coverage_tool_pattern)
Page::Project::Menu.perform(&:go_to_ci_cd_settings)
Page::Project::Settings::CICD.perform do |settings|
Page::Project::Settings::CiCd.perform do |settings|
settings.expand_general_pipelines do |coverage|
coverage.configure_coverage_regex(coverage_tool_pattern)
end
......
# frozen_string_literal: true
require 'securerandom'
module QA
RSpec.describe 'Package', :orchestrated, :packages, :object_storage do
describe 'Composer Repository' do
......
# frozen_string_literal: true
require 'securerandom'
module QA
RSpec.describe 'Package', :orchestrated, :packages, :reliable, :object_storage do
describe 'Maven Repository' do
......
# frozen_string_literal: true
require 'securerandom'
module QA
RSpec.describe 'Package', :orchestrated, :packages, :object_storage do
describe 'NuGet Repository' do
......
# frozen_string_literal: true
require 'pathname'
module QA
RSpec.describe 'Configure' do
let(:project) do
......@@ -102,7 +100,7 @@ module QA
project.visit!
Page::Project::Menu.perform(&:go_to_ci_cd_settings)
Page::Project::Settings::CICD.perform(&:expand_auto_devops)
Page::Project::Settings::CiCd.perform(&:expand_auto_devops)
Page::Project::Settings::AutoDevops.perform(&:enable_autodevops)
# Create AutoDevOps repo
......
# frozen_string_literal: true
require 'airborne'
require 'securerandom'
module QA
RSpec.describe 'Enablement:Search' do
......@@ -52,7 +51,7 @@ module QA
def expect_search_to_find_project(search_term)
QA::Support::Retrier.retry_on_exception(max_attempts: Runtime::Search::RETRY_MAX_ITERATION, sleep_interval: Runtime::Search::RETRY_SLEEP_INTERVAL) do
get Runtime::Search.create_search_request(api_client, 'projects', search_term).url
expect_status(QA::Support::Api::HTTP_STATUS_OK)
expect_status(QA::Support::API::HTTP_STATUS_OK)
raise 'Empty search result returned' if json_body.empty?
......
# frozen_string_literal: true
require 'airborne'
require 'securerandom'
module QA
RSpec.describe 'Enablement:Search' do
......@@ -54,7 +53,7 @@ module QA
it 'does not find a blob as an non-member user', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/746' do
QA::Support::Retrier.retry_on_exception(max_attempts: Runtime::Search::RETRY_MAX_ITERATION, sleep_interval: Runtime::Search::RETRY_SLEEP_INTERVAL) do
get Runtime::Search.create_search_request(non_member_api_client, 'blobs', project_file_content).url
expect_status(QA::Support::Api::HTTP_STATUS_OK)
expect_status(QA::Support::API::HTTP_STATUS_OK)
expect(json_body).to be_empty
end
end
......@@ -65,7 +64,7 @@ module QA
def successful_search(api_client)
QA::Support::Retrier.retry_on_exception(max_attempts: Runtime::Search::RETRY_MAX_ITERATION, sleep_interval: Runtime::Search::RETRY_SLEEP_INTERVAL) do
get Runtime::Search.create_search_request(api_client, 'blobs', project_file_content).url
expect_status(QA::Support::Api::HTTP_STATUS_OK)
expect_status(QA::Support::API::HTTP_STATUS_OK)
raise 'Empty search result returned' if json_body.empty?
......
# frozen_string_literal: true
require 'airborne'
require 'securerandom'
module QA
RSpec.describe 'Enablement:Search' do
......@@ -44,7 +43,7 @@ module QA
start_time = Time.now
while (Time.now - start_time) / 60 < p1_threshold
get Runtime::Search.create_search_request(api_client, 'blobs', project_file_content).url
expect_status(QA::Support::Api::HTTP_STATUS_OK)
expect_status(QA::Support::API::HTTP_STATUS_OK)
if !json_body.empty? && json_body[0][:data].match(project_file_content) && json_body[0][:project_id].equal?(project.id)
break
......
# frozen_string_literal: true
require 'securerandom'
module QA
RSpec.describe 'Manage' do
include Support::Api
include Support::API
let(:api_client) { Runtime::API::Client.new(:gitlab) }
......
# frozen_string_literal: true
require 'securerandom'
module QA
RSpec.describe 'Manage' do
......
# frozen_string_literal: true
require 'securerandom'
module QA
RSpec.describe 'Manage' do
describe 'Group file templates', :requires_admin do
include Support::Api
include Support::API
templates = [
{
......
......@@ -3,7 +3,7 @@
module QA
RSpec.describe 'Manage', :orchestrated, :ldap_tls, :ldap_no_tls, :requires_admin do
describe 'LDAP Group sync' do
include Support::Api
include Support::API
let(:group) do
Resource::Group.fabricate_via_api! do |resource|
......
......@@ -4,7 +4,7 @@ module QA
# TODO: Remove :requires_admin meta when the `Runtime::Feature.enable` method call is removed
RSpec.describe 'Manage', :group_saml, :orchestrated, :requires_admin do
describe 'Group SAML SSO - Enforced SSO' do
include Support::Api
include Support::API
let!(:group) do
Resource::Sandbox.fabricate_via_api! do |sandbox_group|
......
......@@ -3,7 +3,7 @@
module QA
RSpec.describe 'Manage', :group_saml, :orchestrated, :requires_admin do
describe 'Group SAML SSO - Enforced SSO' do
include Support::Api
include Support::API
let!(:group) do
Resource::Sandbox.fabricate_via_api! do |sandbox_group|
......
......@@ -3,7 +3,7 @@
module QA
RSpec.describe 'Manage', :group_saml, :orchestrated, :requires_admin do
describe 'Group SAML SSO - Non enforced SSO' do
include Support::Api
include Support::API
let(:user) { Resource::User.fabricate_via_api! }
......
# frozen_string_literal: true
require 'securerandom'
module QA
RSpec.describe 'Manage' do
......
# frozen_string_literal: true
require 'securerandom'
module QA
# Issue to enable this test in live environments: https://gitlab.com/gitlab-org/quality/team-tasks/-/issues/614
......
# frozen_string_literal: true
require 'securerandom'
module QA
RSpec.describe 'Manage' do
describe 'Project templates' do
include Support::Api
include Support::API
before(:all) do
@files = [
......
# frozen_string_literal: true
require 'securerandom'
module QA
RSpec.describe 'Plan', :reliable do
describe 'Custom email', :requires_admin do
......
# frozen_string_literal: true
require 'securerandom'
module QA
RSpec.describe 'Plan', :reliable do
describe 'Group issue boards' do
......
# frozen_string_literal: true
require 'securerandom'
module QA
RSpec.describe 'Plan', :reliable do
describe 'Group issue boards' do
......
# frozen_string_literal: true
require 'faker'
module QA
RSpec.describe 'Verify' do
describe 'Cancelling merge request in merge train', :runner, :requires_admin do
......
# frozen_string_literal: true
require 'faker'
module QA
RSpec.describe 'Verify', :docker, :runner do
describe 'In merge trains' do
......
# frozen_string_literal: true
require 'octokit'
require 'faker'
require 'base64'
module QA
......
# frozen_string_literal: true
require 'faker'
module QA
RSpec.describe 'Verify', :runner, :reliable do
describe 'Pipelines for merged results and merge trains' do
......
# frozen_string_literal: true
require 'securerandom'
module QA
RSpec.describe 'Verify', :runner, :transient do
describe 'Merge trains transient bugs' do
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment