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
413163f9
Commit
413163f9
authored
Aug 13, 2021
by
Ramya Authappan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dependency-proxy-test' into 'master'
Dependency proxy test See merge request gitlab-org/gitlab!66468
parents
83fe069e
a9cd8c89
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
141 additions
and
2 deletions
+141
-2
app/views/groups/dependency_proxies/_url.html.haml
app/views/groups/dependency_proxies/_url.html.haml
+1
-1
app/views/groups/dependency_proxies/show.html.haml
app/views/groups/dependency_proxies/show.html.haml
+1
-1
qa/qa.rb
qa/qa.rb
+1
-0
qa/qa/page/group/dependency_proxy.rb
qa/qa/page/group/dependency_proxy.rb
+26
-0
qa/qa/page/group/menu.rb
qa/qa/page/group/menu.rb
+8
-0
qa/qa/specs/features/browser_ui/5_package/dependency_proxy_spec.rb
...cs/features/browser_ui/5_package/dependency_proxy_spec.rb
+104
-0
No files found.
app/views/groups/dependency_proxies/_url.html.haml
View file @
413163f9
...
...
@@ -8,5 +8,5 @@
=
clipboard_button
(
text:
"
#{
proxy_url
}
"
,
title:
_
(
"Copy %{proxy_url}"
)
%
{
proxy_url:
proxy_url
})
.row
.col-12.help-block.gl-mt-3
.col-12.help-block.gl-mt-3
{
data:
{
qa_selector:
'dependency_proxy_count'
}
}
=
_
(
'Contains %{count} blobs of images (%{size})'
)
%
{
count:
@blobs_count
,
size:
number_to_human_size
(
@blobs_total_size
)
}
app/views/groups/dependency_proxies/show.html.haml
View file @
413163f9
...
...
@@ -13,7 +13,7 @@
.form-group
%h5
.prepend-top-20
=
_
(
'Enable proxy'
)
.js-dependency-proxy-toggle-area
=
render
"shared/buttons/project_feature_toggle"
,
is_checked:
@dependency_proxy
.
enabled?
,
label:
s_
(
"DependencyProxy|Toggle Dependency Proxy"
)
do
=
render
"shared/buttons/project_feature_toggle"
,
is_checked:
@dependency_proxy
.
enabled?
,
label:
s_
(
"DependencyProxy|Toggle Dependency Proxy"
)
,
data:
{
qa_selector:
'dependency_proxy_setting_toggle'
}
do
=
f
.
hidden_field
:enabled
,
{
class:
'js-project-feature-toggle-input'
}
-
if
@dependency_proxy
.
enabled
...
...
qa/qa.rb
View file @
413163f9
...
...
@@ -239,6 +239,7 @@ module QA
autoload
:Menu
,
'qa/page/group/menu'
autoload
:Members
,
'qa/page/group/members'
autoload
:BulkImport
,
'qa/page/group/bulk_import'
autoload
:DependencyProxy
,
'qa/page/group/dependency_proxy'
module
Milestone
autoload
:Index
,
'qa/page/group/milestone/index'
...
...
qa/qa/page/group/dependency_proxy.rb
0 → 100644
View file @
413163f9
# frozen_string_literal: true
module
QA
module
Page
module
Group
class
DependencyProxy
<
QA
::
Page
::
Base
view
'app/views/groups/dependency_proxies/show.html.haml'
do
element
:dependency_proxy_setting_toggle
end
view
'app/views/groups/dependency_proxies/_url.html.haml'
do
element
:dependency_proxy_count
end
def
has_dependency_proxy_enabled?
toggle
=
find_element
(
:dependency_proxy_setting_toggle
)
toggle
[
:class
].
include?
(
'is-checked'
)
end
def
has_blob_count?
(
blob_text
)
has_element?
(
:dependency_proxy_count
,
text:
blob_text
)
end
end
end
end
end
qa/qa/page/group/menu.rb
View file @
413163f9
...
...
@@ -70,6 +70,14 @@ module QA
end
end
def
go_to_dependency_proxy
hover_group_packages
do
within_submenu
do
click_element
(
:sidebar_menu_item_link
,
menu_item:
'Dependency Proxy'
)
end
end
end
private
def
hover_issues
...
...
qa/qa/specs/features/browser_ui/5_package/dependency_proxy_spec.rb
0 → 100644
View file @
413163f9
# frozen_string_literal: true
module
QA
RSpec
.
describe
'Package'
,
:orchestrated
,
:registry
do
describe
'Dependency Proxy'
do
let
(
:project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'dependency-proxy-project'
project
.
visibility
=
:private
end
end
let!
(
:runner
)
do
Resource
::
Runner
.
fabricate!
do
|
runner
|
runner
.
name
=
"qa-runner-
#{
Time
.
now
.
to_i
}
"
runner
.
tags
=
[
"runner-for-
#{
project
.
name
}
"
]
runner
.
executor
=
:docker
runner
.
project
=
project
end
end
let
(
:uri
)
{
URI
.
parse
(
Runtime
::
Scenario
.
gitlab_address
)
}
let
(
:gitlab_host_with_port
)
{
"
#{
uri
.
host
}
:
#{
uri
.
port
}
"
}
let
(
:dependency_proxy_url
)
{
"
#{
gitlab_host_with_port
}
/
#{
project
.
group
.
full_path
}
/dependency_proxy/containers"
}
before
do
Flow
::
Login
.
sign_in
project
.
group
.
visit!
Page
::
Group
::
Menu
.
perform
(
&
:go_to_dependency_proxy
)
Page
::
Group
::
DependencyProxy
.
perform
do
|
index
|
expect
(
index
).
to
have_dependency_proxy_enabled
end
end
after
do
runner
.
remove_via_api!
end
where
(
:docker_client_version
)
do
%w[docker:19.03.12 docker:20.10]
end
with_them
do
it
"pulls an image using the dependency proxy"
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1862'
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
dependency-proxy-pull-test:
image: "
#{
docker_client_version
}
"
services:
- name: "
#{
docker_client_version
}
-dind"
command:
- /bin/sh
- -c
- |
apk add --no-cache openssl
true | openssl s_client -showcerts -connect gitlab.test:5050 > /usr/local/share/ca-certificates/gitlab.test.crt
update-ca-certificates
dockerd-entrypoint.sh || exit
before_script:
- apk add curl jq grep
- docker login -u "$CI_DEPENDENCY_PROXY_USER" -p "$CI_DEPENDENCY_PROXY_PASSWORD" "$CI_DEPENDENCY_PROXY_SERVER"
script:
- docker pull
#{
dependency_proxy_url
}
/alpine:latest
- TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq --raw-output .token)
- 'curl --head --header "Authorization: Bearer $TOKEN" "https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest" 2>&1'
- docker pull
#{
dependency_proxy_url
}
/alpine:latest
- 'curl --head --header "Authorization: Bearer $TOKEN" "https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest" 2>&1'
tags:
- "runner-for-
#{
project
.
name
}
"
YAML
}])
end
project
.
visit!
Flow
::
Pipeline
.
visit_latest_pipeline
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
click_job
(
'dependency-proxy-pull-test'
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
800
)
end
project
.
group
.
visit!
Page
::
Group
::
Menu
.
perform
(
&
:go_to_dependency_proxy
)
Page
::
Group
::
DependencyProxy
.
perform
do
|
index
|
expect
(
index
).
to
have_blob_count
(
"Contains 2 blobs of images"
)
end
end
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