Commit 00415f09 authored by Dan Davison's avatar Dan Davison

Merge branch 'qa-add-testcase-links-to-container-registry-omnibus-spec' into 'master'

Add test case links to container registry omnibus e2e spec

See merge request gitlab-org/gitlab!80760
parents 00ddfebf 67ac3c78
...@@ -49,10 +49,63 @@ module QA ...@@ -49,10 +49,63 @@ module QA
end end
context "when tls is disabled" do context "when tls is disabled" do
where(:authentication_token_type, :token_name) do where do
:personal_access_token | 'Personal Access Token' {
:project_deploy_token | 'Deploy Token' 'using docker:18.09.9 and a personal access token' => {
:ci_job_token | 'Job Token' docker_client_version: 'docker:18.09.9',
authentication_token_type: :personal_access_token,
token_name: 'Personal Access Token',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348499'
},
'using docker:18.09.9 and a project deploy token' => {
docker_client_version: 'docker:18.09.9',
authentication_token_type: :project_deploy_token,
token_name: 'Deploy Token',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348852'
},
'using docker:18.09.9 and a ci job token' => {
docker_client_version: 'docker:18.09.9',
authentication_token_type: :ci_job_token,
token_name: 'Job Token',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348765'
},
'using docker:19.03.12 and a personal access token' => {
docker_client_version: 'docker:19.03.12',
authentication_token_type: :personal_access_token,
token_name: 'Personal Access Token',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348507'
},
'using docker:19.03.12 and a project deploy token' => {
docker_client_version: 'docker:19.03.12',
authentication_token_type: :project_deploy_token,
token_name: 'Deploy Token',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348859'
},
'using docker:19.03.12 and a ci job token' => {
docker_client_version: 'docker:19.03.12',
authentication_token_type: :ci_job_token,
token_name: 'Job Token',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348654'
},
'using docker:20.10 and a personal access token' => {
docker_client_version: 'docker:20.10',
authentication_token_type: :personal_access_token,
token_name: 'Personal Access Token',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348754'
},
'using docker:20.10 and a project deploy token' => {
docker_client_version: 'docker:20.10',
authentication_token_type: :project_deploy_token,
token_name: 'Deploy Token',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348856'
},
'using docker:20.10 and a ci job token' => {
docker_client_version: 'docker:20.10',
authentication_token_type: :ci_job_token,
token_name: 'Job Token',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348766'
}
}
end end
with_them do with_them do
...@@ -78,57 +131,51 @@ module QA ...@@ -78,57 +131,51 @@ module QA
end end
end end
where(:docker_client_version) do it "pushes image and deletes tag", :registry, testcase: params[:testcase] do
%w[docker:18.09.9 docker:19.03.12 docker:20.10] Support::Retrier.retry_on_exception(max_attempts: 3, sleep_interval: 2) do
end Resource::Repository::Commit.fabricate_via_api! do |commit|
commit.project = project
with_them do commit.commit_message = 'Add .gitlab-ci.yml'
it "pushes image and deletes tag", :registry do commit.add_files([{
Support::Retrier.retry_on_exception(max_attempts: 3, sleep_interval: 2) do file_path: '.gitlab-ci.yml',
Resource::Repository::Commit.fabricate_via_api! do |commit| content:
commit.project = project <<~YAML
commit.commit_message = 'Add .gitlab-ci.yml' build:
commit.add_files([{ image: "#{docker_client_version}"
file_path: '.gitlab-ci.yml', stage: build
content: services:
<<~YAML - name: "#{docker_client_version}-dind"
build: command: ["--insecure-registry=gitlab.test:5050"]
image: "#{docker_client_version}" variables:
stage: build IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
services: script:
- name: "#{docker_client_version}-dind" - docker login -u #{auth_user} -p #{auth_token} gitlab.test:5050
command: ["--insecure-registry=gitlab.test:5050"] - docker build -t $IMAGE_TAG .
variables: - docker push $IMAGE_TAG
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG tags:
script: - "runner-for-#{project.name}"
- docker login -u #{auth_user} -p #{auth_token} gitlab.test:5050 YAML
- docker build -t $IMAGE_TAG . }])
- docker push $IMAGE_TAG
tags:
- "runner-for-#{project.name}"
YAML
}])
end
end end
end
Flow::Pipeline.visit_latest_pipeline Flow::Pipeline.visit_latest_pipeline
Page::Project::Pipeline::Show.perform do |pipeline| Page::Project::Pipeline::Show.perform do |pipeline|
pipeline.click_job('build') pipeline.click_job('build')
end end
Page::Project::Job::Show.perform do |job| Page::Project::Job::Show.perform do |job|
expect(job).to be_successful(timeout: 800) expect(job).to be_successful(timeout: 800)
end end
Page::Project::Menu.perform(&:go_to_container_registry) Page::Project::Menu.perform(&:go_to_container_registry)
Page::Project::Registry::Show.perform do |registry| Page::Project::Registry::Show.perform do |registry|
expect(registry).to have_registry_repository(project.path_with_namespace) expect(registry).to have_registry_repository(project.path_with_namespace)
registry.click_on_image(project.path_with_namespace) registry.click_on_image(project.path_with_namespace)
expect(registry).to have_tag('master') expect(registry).to have_tag('master')
end
end end
end end
end end
...@@ -156,7 +203,7 @@ module QA ...@@ -156,7 +203,7 @@ module QA
apk add --no-cache openssl apk add --no-cache openssl
true | openssl s_client -showcerts -connect gitlab.test:5050 > /usr/local/share/ca-certificates/gitlab.test.crt true | openssl s_client -showcerts -connect gitlab.test:5050 > /usr/local/share/ca-certificates/gitlab.test.crt
update-ca-certificates update-ca-certificates
dockerd-entrypoint.sh || exit dockerd-entrypoint.sh || exit
variables: variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
script: script:
......
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