diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-22 09:08:43 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-22 09:08:43 +0300 |
commit | 6eb3540d3debf5a2c6882b0dedf6569d52ddf570 (patch) | |
tree | 8c97bc6cff8fe2ca223c167f2edf79d56ad3ecc2 /qa | |
parent | 8b24e02decdfb0914eba4ea9980699069e80036b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa/page/component/invite_members_modal.rb | 12 | ||||
-rw-r--r-- | qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb | 68 |
2 files changed, 43 insertions, 37 deletions
diff --git a/qa/qa/page/component/invite_members_modal.rb b/qa/qa/page/component/invite_members_modal.rb index 7cec4588af5..fecd61fb410 100644 --- a/qa/qa/page/component/invite_members_modal.rb +++ b/qa/qa/page/component/invite_members_modal.rb @@ -40,18 +40,20 @@ module QA click_element :invite_a_group_button end - def add_member(username, access_level = Resource::Members::AccessLevel::DEVELOPER) + def add_member(username, access_level = 'Developer') open_invite_members_modal within_element(:invite_members_modal_content) do - fill_element :access_level_dropdown, with: access_level - fill_element :members_token_select_input, username - Support::WaitForRequests.wait_for_requests - click_button username + # Guest option is selected by default, skipping these steps if desired option is 'Guest' + unless access_level == 'Guest' + click_element :access_level_dropdown + click_button access_level + end + click_element :invite_button end diff --git a/qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb b/qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb index 8e61ec4d2d7..f4a5c715684 100644 --- a/qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb +++ b/qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb @@ -5,27 +5,31 @@ require 'digest/sha1' module QA RSpec.describe 'Release', :runner do describe 'Git clone using a deploy key' do - before do - Flow::Login.sign_in - - @runner_name = "qa-runner-#{Time.now.to_i}" + let(:runner_name) { "qa-runner-#{SecureRandom.hex(4)}" } + let(:repository_location) { project.repository_ssh_location } - @project = Resource::Project.fabricate_via_api! do |project| + let(:project) do + Resource::Project.fabricate_via_api! do |project| project.name = 'deploy-key-clone-project' end + end - @repository_location = @project.repository_ssh_location - - @runner = Resource::Runner.fabricate_via_api! do |resource| - resource.project = @project - resource.name = @runner_name - resource.tags = %w[qa docker] + let!(:runner) do + Resource::Runner.fabricate_via_api! do |resource| + resource.project = project + resource.name = runner_name + resource.tags = [runner_name] resource.image = 'gitlab/gitlab-runner:alpine' end end + before do + Flow::Login.sign_in + end + after do - @runner.remove_via_api! + runner.remove_via_api! + project.remove_via_api! end keys = [ @@ -39,7 +43,7 @@ module QA key = key_class.new(*bits) Resource::DeployKey.fabricate_via_browser_ui! do |resource| - resource.project = @project + resource.project = project resource.title = "deploy key #{key.name}(#{key.bits})" resource.key = key.public_key end @@ -49,25 +53,23 @@ module QA make_ci_variable(deploy_key_name, key) gitlab_ci = <<~YAML - cat-config: - script: - - apk add --update --no-cache openssh-client - - mkdir -p ~/.ssh - - ssh-keyscan -p #{@repository_location.port} #{@repository_location.host} >> ~/.ssh/known_hosts - - eval $(ssh-agent -s) - - ssh-add -D - - echo "$#{deploy_key_name}" | ssh-add - - - git clone #{@repository_location.git_uri} - - cd #{@project.name} - - git checkout #{deploy_key_name} - - sha1sum .gitlab-ci.yml - tags: - - qa - - docker + cat-config: + script: + - which ssh-agent || ( apk --update add openssh-client ) + - mkdir -p ~/.ssh + - ssh-keyscan -p #{repository_location.port} #{repository_location.host} >> ~/.ssh/known_hosts + - eval $(ssh-agent -s) + - ssh-add -D + - echo "$#{deploy_key_name}" | ssh-add - + - git clone #{repository_location.git_uri} + - cd #{project.name} + - git checkout #{deploy_key_name} + - sha1sum .gitlab-ci.yml + tags: [#{runner_name}] YAML Resource::Repository::ProjectPush.fabricate! do |resource| - resource.project = @project + resource.project = project resource.file_name = '.gitlab-ci.yml' resource.commit_message = 'Add .gitlab-ci.yml' resource.file_content = gitlab_ci @@ -81,8 +83,10 @@ module QA Page::Project::Pipeline::Show.perform(&:click_on_first_job) Page::Project::Job::Show.perform do |job| - expect(job).to be_successful - expect(job.output).to include(sha1sum) + aggregate_failures 'job succeeds and has correct sha1sum' do + expect(job).to be_successful + expect(job.output).to include(sha1sum) + end end end @@ -90,7 +94,7 @@ module QA def make_ci_variable(key_name, key) Resource::CiVariable.fabricate_via_api! do |resource| - resource.project = @project + resource.project = project resource.key = key_name resource.value = key.private_key resource.masked = false |