Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-08-05 06:11:46 +00:00
parent 335dc0be1f
commit acda833a93
29 changed files with 76 additions and 52 deletions

View File

@ -1273,9 +1273,9 @@ GEM
fugit (~> 1.1)
sidekiq (>= 4.2.1)
sigdump (0.2.4)
signet (0.14.0)
addressable (~> 2.3)
faraday (>= 0.17.3, < 2.0)
signet (0.17.0)
addressable (~> 2.8)
faraday (>= 0.17.5, < 3.a)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simple_po_parser (1.1.6)

View File

@ -235,7 +235,7 @@ export default {
:fields="fields"
fixed
stacked="md"
class="qa-clusters-table gl-mb-4!"
class="gl-mb-4!"
data-testid="cluster_list_table"
>
<template #cell(name)="{ item }">

View File

@ -290,7 +290,6 @@ export default {
<template v-else>
<reply-placeholder
v-if="!isFormVisible"
class="qa-discussion-reply"
:placeholder-text="__('Reply…')"
@focus="showForm"
/>

View File

@ -372,7 +372,7 @@ export default {
</div>
<div
v-show="hasDesigns"
class="qa-selector-toolbar gl-display-flex gl-align-items-center gl-my-2"
class="gl-display-flex gl-align-items-center gl-my-2"
data-testid="design-selector-toolbar"
>
<gl-button

View File

@ -627,7 +627,7 @@ export default {
:title="model.name"
class="environment-name table-mobile-content"
>
<a class="qa-environment-link" :href="environmentPath">
<a data-qa-selector="environment_link" :href="environmentPath">
<span v-if="model.size === 1">{{ model.name }}</span>
<span v-else>{{ model.name_without_type }}</span>
</a>

View File

@ -42,7 +42,7 @@ export default {
</script>
<template>
<div class="groups-list-tree-container qa-groups-list-tree-container">
<div class="groups-list-tree-container" data-qa-selector="groups_list_tree_container">
<div
v-if="searchEmpty"
class="has-no-search-results gl-font-style-italic gl-text-center gl-text-gray-600 gl-p-5"

View File

@ -70,7 +70,6 @@ export default {
<input type="hidden" name="new_parent_group_id" :value="selectedId" />
</gl-form-group>
<confirm-danger
button-class="qa-transfer-button"
:disabled="disableSubmitButton"
:phrase="confirmationPhrase"
:button-text="confirmButtonText"

View File

@ -156,7 +156,7 @@ export default {
category="primary"
variant="confirm"
block
class="qa-begin-commit-button"
data-qa-selector="begin_commit_button"
data-testid="begin-commit-button"
@click="beginCommit"
>
@ -184,7 +184,7 @@ export default {
:disabled="commitButtonDisabled"
:loading="submitCommitLoading"
data-testid="commit-button"
class="qa-commit-button"
data-qa-selector="commit_button"
category="primary"
variant="confirm"
type="submit"

View File

@ -80,7 +80,9 @@ export default {
<template>
<div
class="gl-display-flex gl-align-items-center ide-file-templates qa-file-templates-bar gl-relative gl-z-index-1"
class="gl-display-flex gl-align-items-center ide-file-templates gl-relative gl-z-index-1"
data-testid="file-templates-bar"
data-qa-selector="file_templates_container"
>
<strong class="gl-mr-3"> {{ $options.i18n.barLabel }} </strong>
<gl-dropdown
@ -97,7 +99,8 @@ export default {
</gl-dropdown>
<gl-dropdown
v-if="showTemplatesDropdown"
class="gl-mr-6 qa-file-template-dropdown"
class="gl-mr-6"
data-qa-selector="file_template_dropdown"
:text="$options.i18n.templateListDropdownLabel"
@show="fetchTemplateTypes"
>

View File

@ -52,7 +52,7 @@ export default {
</script>
<template>
<div class="ide-file-list qa-file-list">
<div class="ide-file-list" data-qa-selector="file_list_container">
<template v-if="showLoading">
<div v-for="n in 3" :key="n" class="multi-file-loading-container">
<gl-skeleton-loader />

View File

@ -57,7 +57,6 @@ export default {
/>
</gl-form-group>
<confirm-danger
button-class="qa-transfer-button"
:disabled="!hasSelectedNamespace"
:phrase="confirmationPhrase"
:button-text="confirmButtonText"

View File

@ -53,6 +53,7 @@ export default {
:variant="buttonVariant"
:disabled="disabled"
:data-testid="buttonTestid"
data-qa-selector="confirm_danger_button"
>{{ buttonText }}</gl-button
>
<confirm-danger-modal

View File

@ -66,7 +66,13 @@ export default {
actionPrimary() {
return {
text: this.confirmButtonText,
attributes: [{ variant: 'danger', disabled: !this.isValid, class: 'qa-confirm-button' }],
attributes: [
{
variant: 'danger',
disabled: !this.isValid,
'data-qa-selector': 'confirm_danger_modal_button',
},
],
};
},
actionCancel() {
@ -122,7 +128,8 @@ export default {
<gl-form-input
id="confirm_name_input"
v-model="confirmationPhrase"
class="form-control qa-confirm-input"
class="form-control"
data-qa-selector="confirm_danger_field"
data-testid="confirm-danger-input"
type="text"
/>

View File

@ -1,5 +1,5 @@
.form-actions.gl-display-flex
= render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm, button_options: { id: 'commit-changes', class: 'js-commit-button qa-commit-button' }) do
= render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm, button_options: { id: 'commit-changes', class: 'js-commit-button', data: { qa_selector: 'commit_button' } }) do
= _('Commit changes')
= render Pajamas::ButtonComponent.new(href: cancel_path, button_options: { class: 'gl-ml-3', id: 'cancel-changes', aria: { label: _('Discard changes') }, data: { confirm: leave_edit_message, confirm_btn_variant: "danger" } }) do

View File

@ -22,8 +22,8 @@
%label{ for: "confirm_path_input" }
= _("To confirm, type %{phrase_code}").html_safe % { phrase_code: '<code class="js-legacy-confirm-danger-match">%{phrase_name}</code>'.html_safe % { phrase_name: @project.full_path } }
.form-group
= text_field_tag 'confirm_path_input', '', class: 'form-control js-legacy-confirm-danger-input qa-confirm-input'
= text_field_tag 'confirm_path_input', '', class: 'form-control js-legacy-confirm-danger-input'
.form-actions
%button.btn.gl-button.btn-default.gl-mr-4{ type: "button", "data-dismiss": "modal" }
= _('Cancel')
= submit_tag _('Reduce project visibility'), class: "btn gl-button btn-danger js-legacy-confirm-danger-submit qa-confirm-button", disabled: true
= submit_tag _('Reduce project visibility'), class: "btn gl-button btn-danger js-legacy-confirm-danger-submit", disabled: true

View File

@ -12,21 +12,26 @@ module QA
base.view 'app/assets/javascripts/lib/utils/confirm_via_gl_modal/confirm_modal.vue' do
element :confirm_ok_button
end
base.view 'app/assets/javascripts/vue_shared/components/confirm_danger/confirm_danger_modal.vue' do
element :confirm_danger_modal_button
element :confirm_danger_field
end
end
def fill_confirmation_text(text)
fill_element(:confirm_input, text)
fill_element(:confirm_danger_field, text)
end
def wait_for_confirm_button_enabled
wait_until(reload: false) do
!find_element(:confirm_button).disabled?
!find_element(:confirm_danger_modal_button).disabled?
end
end
def confirm_transfer
wait_for_confirm_button_enabled
click_element(:confirm_button)
click_element(:confirm_danger_modal_button)
end
def click_confirmation_ok_button

View File

@ -8,6 +8,10 @@ module QA
include QA::Page::Component::ConfirmModal
include Component::NamespaceSelect
view 'app/assets/javascripts/vue_shared/components/confirm_danger/confirm_danger.vue' do
element :confirm_danger_button
end
view 'app/views/projects/edit.html.haml' do
element :project_path_field
element :change_path_button
@ -47,7 +51,7 @@ module QA
# https://gitlab.com/gitlab-org/gitlab/-/issues/218965
select_namespace(namespace.gsub(%r{([^\s])/([^\s])}, '\1 / \2'))
click_element(:transfer_button)
click_element(:confirm_danger_button)
fill_confirmation_text(project_name)
confirm_transfer
end

View File

@ -24,11 +24,11 @@ module QA
end
view 'app/assets/javascripts/ide/components/ide_tree_list.vue' do
element :file_list
element :file_list_container
end
view 'app/assets/javascripts/ide/components/file_templates/bar.vue' do
element :file_templates_bar
element :file_templates_container
element :file_template_dropdown
end
@ -110,7 +110,7 @@ module QA
end
def has_file?(file_name)
within_element(:file_list) do
within_element(:file_list_container) do
has_element?(:file_name_content, file_name: file_name)
end
end
@ -173,7 +173,7 @@ module QA
has_no_element?(:new_file_modal)
wait_until(reload: false) do
within_element(:file_templates_bar) do
within_element(:file_templates_container) do
click_element :file_template_dropdown
fill_element :dropdown_filter_input, template
@ -291,12 +291,12 @@ module QA
click_element(:fork_project_button)
# wait for the fork to be created
wait_until(reload: true) do
has_element?(:file_list)
has_element?(:file_list_container)
end
end
def upload_file(file_path)
within_element(:file_list) do
within_element(:file_list_container) do
find_element(:file_upload_field, visible: false).send_keys(file_path)
end
end

View File

@ -18,7 +18,7 @@ RSpec.describe 'Projects > Files > Project owner sees a link to create a license
expect(page).to have_current_path("/-/ide/project/#{project.full_path}/edit/master/-/LICENSE", ignore_query: true)
expect(page).to have_selector('.qa-file-templates-bar') # rubocop:disable QA/SelectorUsage
expect(page).to have_selector('[data-testid="file-templates-bar"]')
select_template('MIT License')

View File

@ -49,8 +49,8 @@ RSpec.describe 'Multi-file editor new directory', :js do
# Compact mode depends on the size of window. If it is shorter than MAX_WINDOW_HEIGHT_COMPACT,
# (as it is with WEBDRIVER_HEADLESS=0), this initial commit button will exist. Otherwise, if it is
# taller (as it is by default with chrome headless) then the button will not exist.
if page.has_css?('.qa-begin-commit-button') # rubocop:disable QA/SelectorUsage
find('.qa-begin-commit-button').click # rubocop:disable QA/SelectorUsage
if page.has_css?('[data-testid="begin-commit-button"]')
find('[data-testid="begin-commit-button"]').click
end
fill_in('commit-message', with: 'commit message ide')

View File

@ -39,8 +39,8 @@ RSpec.describe 'Multi-file editor new file', :js do
# Compact mode depends on the size of window. If it is shorter than MAX_WINDOW_HEIGHT_COMPACT,
# (as it is with WEBDRIVER_HEADLESS=0), this initial commit button will exist. Otherwise, if it is
# taller (as it is by default with chrome headless) then the button will not exist.
if page.has_css?('.qa-begin-commit-button') # rubocop:disable QA/SelectorUsage
find('.qa-begin-commit-button').click # rubocop:disable QA/SelectorUsage
if page.has_css?('[data-testid="begin-commit-button"]')
find('[data-testid="begin-commit-button"]').click
end
fill_in('commit-message', with: 'commit message ide')

View File

@ -82,7 +82,6 @@ describe('Transfer group form', () => {
it('sets the confirm danger properties', () => {
expect(findConfirmDanger().props()).toMatchObject({
buttonClass: 'qa-transfer-button',
disabled: true,
buttonText: confirmButtonText,
phrase: confirmationPhrase,

View File

@ -2,10 +2,11 @@
require "spec_helper"
RSpec.describe Gitlab::Git::Tree, :seed_helper do
RSpec.describe Gitlab::Git::Tree do
let_it_be(:user) { create(:user) }
let(:repository) { Gitlab::Git::Repository.new('default', TEST_REPO_PATH, '', 'group/project') }
let(:project) { create(:project, :repository) }
let(:repository) { project.repository.raw }
shared_examples :repo do
subject(:tree) { Gitlab::Git::Tree.where(repository, sha, path, recursive, pagination_params) }
@ -105,10 +106,6 @@ RSpec.describe Gitlab::Git::Tree, :seed_helper do
).newrev
end
after do
ensure_seeds
end
it { expect(subdir_file.flat_path).to eq('files/flat/path/correct') }
end
end

View File

@ -135,7 +135,7 @@ RSpec.describe PagesDomains::ObtainLetsEncryptCertificateService do
cert.add_extension ef.create_extension("authorityKeyIdentifier",
"keyid:always,issuer:always")
cert.sign key, OpenSSL::Digest.new('SHA1')
cert.sign key, OpenSSL::Digest.new('SHA256')
cert.to_pem
end

View File

@ -391,6 +391,11 @@ RSpec.configure do |config|
Gitlab::WithRequestStore.with_request_store { example.run }
end
config.around(:example, :enable_rugged) do |example|
# Skip tests that need rugged when using praefect DB.
example.run unless GitalySetup.praefect_with_db?
end
# previous test runs may have left some resources throttled
config.before do
::Gitlab::ExclusiveLease.reset_all!("el:throttle:*")

View File

@ -12,6 +12,8 @@ require 'logger'
require 'fileutils'
require 'bundler'
require_relative '../../../lib/gitlab/utils'
module GitalySetup
extend self
@ -139,7 +141,7 @@ module GitalySetup
end
def start_praefect
if ENV['GITALY_PRAEFECT_WITH_DB']
if praefect_with_db?
LOGGER.debug 'Starting Praefect with database election strategy'
start(:praefect, File.join(tmp_tests_gitaly_dir, 'praefect-db.config.toml'))
else
@ -290,7 +292,7 @@ module GitalySetup
# In CI we need to pre-generate both config files.
# For local testing we'll create the correct file on-demand.
if ENV['CI'] || ENV['GITALY_PRAEFECT_WITH_DB'].nil?
if ENV['CI'] || !praefect_with_db?
Gitlab::SetupHelper::Praefect.create_configuration(
gitaly_dir,
{ 'praefect' => repos_path },
@ -298,7 +300,7 @@ module GitalySetup
)
end
if ENV['CI'] || ENV['GITALY_PRAEFECT_WITH_DB']
if ENV['CI'] || praefect_with_db?
Gitlab::SetupHelper::Praefect.create_configuration(
gitaly_dir,
{ 'praefect' => repos_path },
@ -319,7 +321,7 @@ module GitalySetup
end
def setup_praefect
return unless ENV['GITALY_PRAEFECT_WITH_DB']
return unless praefect_with_db?
migrate_cmd = service_cmd(:praefect, File.join(tmp_tests_gitaly_dir, 'praefect-db.config.toml')) + ['sql-migrate']
system(env, *migrate_cmd, [:out, :err] => 'log/praefect-test.log')
@ -396,4 +398,8 @@ module GitalySetup
def praefect_binary
File.join(tmp_tests_gitaly_dir, "_build", "bin", "praefect")
end
def praefect_with_db?
Gitlab::Utils.to_boolean(ENV['GITALY_PRAEFECT_WITH_DB'], default: false)
end
end

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
# Expects usage of 'incident settings enabled' context.
# Expects usage of 'incident management settings enabled' context.
#
# This shared_example includes the following option:
# - with_issue: includes a test for when the defined `alert` has an associated issue
@ -8,7 +8,7 @@
# This shared_example requires the following variables:
# - `alert`, required if :with_issue is true
RSpec.shared_examples 'processes incident issues if enabled' do |with_issue: false|
include_examples 'processes incident issues', with_issue
include_examples 'processes incident issues', with_issue: with_issue
context 'with incident setting disabled' do
let(:create_issue) { false }

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
# Expects usage of 'incident settings enabled' context.
# Expects usage of 'incident management settings enabled' context.
#
# This shared_example requires the following variables:
# - `alert`, alert for which related incidents should be closed

View File

@ -1,11 +1,11 @@
# frozen_string_literal: true
# Expects usage of 'incident settings enabled' context.
# Expects usage of 'incident management settings enabled' context.
#
# This shared_example includes the following option:
# - count: number of notifications expected to be sent
RSpec.shared_examples 'sends alert notification emails if enabled' do |count: 1|
include_examples 'sends alert notification emails', count
include_examples 'sends alert notification emails', count: count
context 'with email setting disabled' do
let(:send_email) { false }