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
fccd1ae7
Commit
fccd1ae7
authored
Dec 03, 2021
by
Sofia Vistas
Committed by
Anastasia McDonald
Dec 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fabricate group deploy token resource via API
parent
b2b6cb55
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
18 deletions
+38
-18
qa/qa/resource/group_deploy_token.rb
qa/qa/resource/group_deploy_token.rb
+31
-16
qa/qa/specs/features/browser_ui/5_package/package_registry/nuget_repository_spec.rb
...er_ui/5_package/package_registry/nuget_repository_spec.rb
+7
-2
No files found.
qa/qa/resource/group_deploy_token.rb
View file @
fccd1ae7
...
...
@@ -4,18 +4,11 @@ module QA
module
Resource
class
GroupDeployToken
<
Base
attr_accessor
:name
,
:expires_at
attr_writer
:scopes
attribute
:username
do
Page
::
Group
::
Settings
::
Repository
.
perform
do
|
repository_page
|
repository_page
.
expand_deploy_tokens
(
&
:token_username
)
end
end
attribute
:password
do
Page
::
Group
::
Settings
::
Repository
.
perform
do
|
repository_page
|
repository_page
.
expand_deploy_tokens
(
&
:token_password
)
end
end
attribute
:id
attribute
:token
attribute
:username
attribute
:group
do
Group
.
fabricate!
do
|
resource
|
...
...
@@ -24,11 +17,33 @@ module QA
end
end
attribute
:project
do
Project
.
fabricate!
do
|
resource
|
resource
.
name
=
'project-to-deploy'
resource
.
description
=
'project for adding deploy token test'
end
def
fabricate_via_api!
super
end
def
api_get_path
"/groups/
#{
group
.
id
}
/deploy_tokens"
end
def
api_post_path
api_get_path
end
def
api_post_body
{
name:
@name
,
scopes:
@scopes
}
end
def
api_delete_path
"/groups/
#{
group
.
id
}
/deploy_tokens/
#{
id
}
"
end
def
resource_web_url
(
resource
)
super
rescue
ResourceURLMissingError
# this particular resource does not expose a web_url property
end
def
fabricate!
...
...
qa/qa/specs/features/browser_ui/5_package/package_registry/nuget_repository_spec.rb
View file @
fccd1ae7
...
...
@@ -21,9 +21,14 @@ module QA
end
let
(
:group_deploy_token
)
do
Resource
::
GroupDeployToken
.
fabricate_via_
browser_u
i!
do
|
deploy_token
|
Resource
::
GroupDeployToken
.
fabricate_via_
ap
i!
do
|
deploy_token
|
deploy_token
.
name
=
'nuget-group-deploy-token'
deploy_token
.
group
=
project
.
group
deploy_token
.
scopes
=
%w[
read_repository
read_package_registry
write_package_registry
]
end
end
...
...
@@ -70,7 +75,7 @@ module QA
when
:ci_job_token
'${CI_JOB_TOKEN}'
when
:group_deploy_token
"
\"
#{
group_deploy_token
.
password
}
\"
"
"
\"
#{
group_deploy_token
.
token
}
\"
"
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