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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
ab4f8032
Commit
ab4f8032
authored
Feb 13, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inline helper methods
parent
2e9b6b53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
27 deletions
+11
-27
qa/qa/specs/features/project/deploy_key_clone_spec.rb
qa/qa/specs/features/project/deploy_key_clone_spec.rb
+11
-27
No files found.
qa/qa/specs/features/project/deploy_key_clone_spec.rb
View file @
ab4f8032
...
@@ -11,38 +11,41 @@ module QA
...
@@ -11,38 +11,41 @@ module QA
end
end
end
end
def
fabricate_runner
after
do
Service
::
Runner
.
new
(
runner_name
).
remove!
end
scenario
'user sets up a deploy key to clone code using pipelines'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
Factory
::
Resource
::
Runner
.
fabricate!
do
|
resource
|
Factory
::
Resource
::
Runner
.
fabricate!
do
|
resource
|
resource
.
project
=
project
resource
.
project
=
project
resource
.
name
=
runner_name
resource
.
name
=
runner_name
resource
.
tags
=
%w[qa docker]
resource
.
tags
=
%w[qa docker]
resource
.
image
=
'gitlab/gitlab-runner:ubuntu'
resource
.
image
=
'gitlab/gitlab-runner:ubuntu'
end
end
end
def
fabricate_deploy_key
Factory
::
Resource
::
DeployKey
.
fabricate!
do
|
resource
|
Factory
::
Resource
::
DeployKey
.
fabricate!
do
|
resource
|
resource
.
project
=
project
resource
.
project
=
project
resource
.
title
=
'deploy key title'
resource
.
title
=
'deploy key title'
resource
.
key
=
key
.
public_key
resource
.
key
=
key
.
public_key
end
end
end
def
fabricate_secret_variable
Factory
::
Resource
::
SecretVariable
.
fabricate!
do
|
resource
|
Factory
::
Resource
::
SecretVariable
.
fabricate!
do
|
resource
|
resource
.
project
=
project
resource
.
project
=
project
resource
.
key
=
'DEPLOY_KEY'
resource
.
key
=
'DEPLOY_KEY'
resource
.
value
=
key
.
to_pem
resource
.
value
=
key
.
to_pem
end
end
end
def
fabricate_gitlab_ci
project
.
visit!
repository_uri
=
Page
::
Project
::
Show
.
act
do
repository_uri
=
Page
::
Project
::
Show
.
act
do
choose_repository_clone_ssh
choose_repository_clone_ssh
repository_location_uri
repository_location_uri
end
end
<<~
YAML
gitlab_ci
=
<<~
YAML
cat-config:
cat-config:
script:
script:
- mkdir -p ~/.ssh
- mkdir -p ~/.ssh
...
@@ -55,33 +58,14 @@ module QA
...
@@ -55,33 +58,14 @@ module QA
- qa
- qa
- docker
- docker
YAML
YAML
end
def
fabricate_push
(
gitlab_ci
)
Factory
::
Repository
::
Push
.
fabricate!
do
|
resource
|
Factory
::
Repository
::
Push
.
fabricate!
do
|
resource
|
resource
.
project
=
project
resource
.
project
=
project
resource
.
file_name
=
'.gitlab-ci.yml'
resource
.
file_name
=
'.gitlab-ci.yml'
resource
.
commit_message
=
'Add .gitlab-ci.yml'
resource
.
commit_message
=
'Add .gitlab-ci.yml'
resource
.
file_content
=
gitlab_ci
resource
.
file_content
=
gitlab_ci
end
end
end
after
do
Service
::
Runner
.
new
(
runner_name
).
remove!
end
scenario
'user sets up a deploy key to clone code using pipelines'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
fabricate_runner
fabricate_deploy_key
fabricate_secret_variable
project
.
visit!
gitlab_ci
=
fabricate_gitlab_ci
fabricate_push
(
gitlab_ci
)
sha1sum
=
Digest
::
SHA1
.
hexdigest
(
gitlab_ci
)
sha1sum
=
Digest
::
SHA1
.
hexdigest
(
gitlab_ci
)
Page
::
Project
::
Show
.
act
{
wait_for_push
}
Page
::
Project
::
Show
.
act
{
wait_for_push
}
...
...
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