Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
6a96f130
Commit
6a96f130
authored
Nov 26, 2021
by
Sofia Vistas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add 3 latest docker versions on Container Registry test
parent
9d172d15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
66 deletions
+69
-66
qa/qa/specs/features/browser_ui/5_package/container_registry/container_registry_omnibus_spec.rb
...age/container_registry/container_registry_omnibus_spec.rb
+69
-66
No files found.
qa/qa/specs/features/browser_ui/5_package/container_registry/container_registry_omnibus_spec.rb
View file @
6a96f130
...
...
@@ -48,84 +48,87 @@ module QA
project
.
remove_via_api!
end
where
(
:authentication_token_type
,
:token_name
)
do
:personal_access_token
|
'Personal Access Token'
:project_deploy_token
|
'Deploy Token'
:ci_job_token
|
'Job Token'
end
with_them
do
let
(
:auth_token
)
do
case
authentication_token_type
when
:personal_access_token
"
\"
#{
personal_access_token
}
\"
"
when
:project_deploy_token
"
\"
#{
project_deploy_token
.
token
}
\"
"
when
:ci_job_token
'$CI_JOB_TOKEN'
end
context
"when tls is disabled"
do
where
(
:authentication_token_type
,
:token_name
)
do
:personal_access_token
|
'Personal Access Token'
:project_deploy_token
|
'Deploy Token'
:ci_job_token
|
'Job Token'
end
let
(
:auth_user
)
do
case
authentication_token_type
when
:personal_access_token
"$CI_REGISTRY_USER"
when
:project_deploy_token
"
\"
#{
project_deploy_token
.
username
}
\"
"
when
:ci_job_token
'gitlab-ci-token'
with_them
do
let
(
:auth_token
)
do
case
authentication_token_type
when
:personal_access_token
"
\"
#{
personal_access_token
}
\"
"
when
:project_deploy_token
"
\"
#{
project_deploy_token
.
token
}
\"
"
when
:ci_job_token
'$CI_JOB_TOKEN'
end
end
end
context
"when tls is disabled"
do
it
"using a
#{
params
[
:token_name
]
}
, pushes image and deletes tag"
,
:registry
do
Support
::
Retrier
.
retry_on_exception
(
max_attempts:
3
,
sleep_interval:
2
)
do
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
commit
.
project
=
project
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
add_files
([{
file_path:
'.gitlab-ci.yml'
,
content:
<<~
YAML
build:
image: docker:19.03.12
stage: build
services:
- name: docker:19.03.12-dind
command: ["--insecure-registry=gitlab.test:5050"]
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
script:
- docker login -u
#{
auth_user
}
-p
#{
auth_token
}
gitlab.test:5050
- docker build -t $IMAGE_TAG .
- docker push $IMAGE_TAG
tags:
- "runner-for-
#{
project
.
name
}
"
YAML
}])
end
let
(
:auth_user
)
do
case
authentication_token_type
when
:personal_access_token
"$CI_REGISTRY_USER"
when
:project_deploy_token
"
\"
#{
project_deploy_token
.
username
}
\"
"
when
:ci_job_token
'gitlab-ci-token'
end
end
Flow
::
Pipeline
.
visit_latest_pipeline
where
(
:docker_client_version
)
do
%w[docker:18.09.9 docker:19.03.12 docker:20.10]
end
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
click_job
(
'build'
)
end
with_them
do
it
"pushes image and deletes tag"
,
:registry
do
Support
::
Retrier
.
retry_on_exception
(
max_attempts:
3
,
sleep_interval:
2
)
do
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
commit
.
project
=
project
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
add_files
([{
file_path:
'.gitlab-ci.yml'
,
content:
<<~
YAML
build:
image: "
#{
docker_client_version
}
"
stage: build
services:
- name: "
#{
docker_client_version
}
-dind"
command: ["--insecure-registry=gitlab.test:5050"]
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
script:
- docker login -u
#{
auth_user
}
-p
#{
auth_token
}
gitlab.test:5050
- docker build -t $IMAGE_TAG .
- docker push $IMAGE_TAG
tags:
- "runner-for-
#{
project
.
name
}
"
YAML
}])
end
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
800
)
end
Flow
::
Pipeline
.
visit_latest_pipeline
Page
::
Project
::
Menu
.
perform
(
&
:go_to_container_registry
)
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
click_job
(
'build'
)
end
Page
::
Project
::
Registry
::
Show
.
perform
do
|
registry
|
expect
(
registry
).
to
have_registry_repository
(
project
.
path_with_namespace
)
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
800
)
end
Page
::
Project
::
Menu
.
perform
(
&
:go_to_container_registry
)
registry
.
click_on_image
(
project
.
path_with_namespace
)
expect
(
registry
).
to
have_tag
(
'master'
)
Page
::
Project
::
Registry
::
Show
.
perform
do
|
registry
|
expect
(
registry
).
to
have_registry_repository
(
project
.
path_with_namespace
)
registry
.
click_delete
expect
(
registry
).
not_to
have_tag
(
'master'
)
registry
.
click_on_image
(
project
.
path_with_namespace
)
expect
(
registry
).
to
have_tag
(
'master'
)
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment