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
1defb950
Commit
1defb950
authored
Jun 04, 2018
by
Dylan Griffith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Factory::Repository::Push to allow pushing directory to simplfy auto devops spec
parent
282c09ed
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
20 deletions
+25
-20
qa/qa/factory/repository/push.rb
qa/qa/factory/repository/push.rb
+17
-2
qa/qa/specs/features/project/auto_devops_spec.rb
qa/qa/specs/features/project/auto_devops_spec.rb
+8
-18
No files found.
qa/qa/factory/repository/push.rb
View file @
1defb950
...
...
@@ -15,15 +15,23 @@ module QA
def
initialize
@file_name
=
'file.txt'
@file_content
=
'# This is test project'
@commit_message
=
"
Add
#{
@file_name
}
"
@commit_message
=
"
This is a test commit
"
@branch_name
=
'master'
@new_branch
=
true
@pushing_directory
=
false
end
def
remote_branch
@remote_branch
||=
branch_name
end
def
directory
=
(
dir
)
raise
"Must set directory as a Pathname"
unless
dir
.
is_a?
(
Pathname
)
@directory
=
dir
@pushing_directory
=
true
end
def
fabricate!
project
.
visit!
...
...
@@ -43,7 +51,14 @@ module QA
repository
.
checkout
(
branch_name
)
end
repository
.
add_file
(
file_name
,
file_content
)
if
@pushing_directory
@directory
.
each_child
do
|
f
|
repository
.
add_file
(
f
.
basename
,
f
.
read
)
if
f
.
file?
end
else
repository
.
add_file
(
file_name
,
file_content
)
end
repository
.
commit
(
commit_message
)
repository
.
push_changes
(
"
#{
branch_name
}
:
#{
remote_branch
}
"
)
end
...
...
qa/qa/specs/features/project/auto_devops_spec.rb
View file @
1defb950
...
...
@@ -16,26 +16,16 @@ module QA
end
# Create Auto Devops compatible repo
project
.
visit!
Git
::
Repository
.
perform
do
|
repository
|
repository
.
uri
=
Page
::
Project
::
Show
.
act
do
choose_repository_clone_http
repository_location
.
uri
end
repository
.
use_default_credentials
repository
.
clone
repository
.
configure_identity
(
'GitLab QA'
,
'root@gitlab.com'
)
repository
.
checkout_new_branch
(
'master'
)
repository
.
add_file
(
'config.ru'
,
File
.
read
(
File
.
join
(
__dir__
,
"../../../fixtures/auto_devops_rack/config.ru"
)))
repository
.
add_file
(
'Gemfile'
,
File
.
read
(
File
.
join
(
__dir__
,
"../../../fixtures/auto_devops_rack/Gemfile"
)))
repository
.
add_file
(
'Gemfile.lock'
,
File
.
read
(
File
.
join
(
__dir__
,
"../../../fixtures/auto_devops_rack/Gemfile.lock"
)))
repository
.
add_file
(
'Rakefile'
,
File
.
read
(
File
.
join
(
__dir__
,
"../../../fixtures/auto_devops_rack/Rakefile"
)))
repository
.
commit
(
'Create auto devops repo'
)
repository
.
push_changes
(
"master:master"
)
Factory
::
Repository
::
Push
.
fabricate!
do
|
push
|
push
.
project
=
project
push
.
directory
=
Pathname
.
new
(
__dir__
)
.
join
(
'../../../fixtures/auto_devops_rack'
)
push
.
commit_message
=
'Create Auto DevOps compatible rack application'
end
Page
::
Project
::
Show
.
act
{
wait_for_push
}
# Create and connect K8s cluster
@cluster
=
Service
::
KubernetesCluster
.
new
.
create!
kubernetes_cluster
=
Factory
::
Resource
::
KubernetesCluster
.
fabricate!
do
|
c
|
...
...
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