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
Léo-Paul Géneau
gitlab-ce
Commits
a10d8adf
Commit
a10d8adf
authored
Apr 24, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename location to uri; Handle uri for HTTP; Fix pushing remote
parent
1421469e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
18 deletions
+24
-18
qa/qa/factory/repository/push.rb
qa/qa/factory/repository/push.rb
+14
-9
qa/qa/factory/resource/branch.rb
qa/qa/factory/resource/branch.rb
+3
-1
qa/qa/git/location.rb
qa/qa/git/location.rb
+1
-1
qa/qa/git/repository.rb
qa/qa/git/repository.rb
+1
-2
qa/qa/specs/features/repository/clone_spec.rb
qa/qa/specs/features/repository/clone_spec.rb
+4
-4
qa/qa/specs/features/repository/protected_branches_spec.rb
qa/qa/specs/features/repository/protected_branches_spec.rb
+1
-1
No files found.
qa/qa/factory/repository/push.rb
View file @
a10d8adf
...
...
@@ -2,7 +2,8 @@ module QA
module
Factory
module
Repository
class
Push
<
Factory
::
Base
attr_writer
:file_name
,
:file_content
,
:commit_message
,
:branch_name
,
:new_branch
attr_accessor
:file_name
,
:file_content
,
:commit_message
,
:branch_name
,
:new_branch
,
:remote_branch
dependency
Factory
::
Resource
::
Project
,
as: :project
do
|
project
|
project
.
name
=
'project-with-code'
...
...
@@ -17,28 +18,32 @@ module QA
@new_branch
=
true
end
def
remote_branch
@remote_branch
||=
branch_name
end
def
fabricate!
project
.
visit!
Git
::
Repository
.
perform
do
|
repository
|
repository
.
location
=
Page
::
Project
::
Show
.
act
do
repository
.
uri
=
Page
::
Project
::
Show
.
act
do
choose_repository_clone_http
repository_location
.
git_
uri
repository_location
.
uri
end
repository
.
use_default_credentials
repository
.
clone
repository
.
configure_identity
(
'GitLab QA'
,
'root@gitlab.com'
)
if
@
new_branch
repository
.
checkout_new_branch
(
@
branch_name
)
if
new_branch
repository
.
checkout_new_branch
(
branch_name
)
else
repository
.
checkout
(
@
branch_name
)
repository
.
checkout
(
branch_name
)
end
repository
.
add_file
(
@file_name
,
@
file_content
)
repository
.
commit
(
@
commit_message
)
repository
.
push_changes
(
@branch_name
)
repository
.
add_file
(
file_name
,
file_content
)
repository
.
commit
(
commit_message
)
repository
.
push_changes
(
"
#{
branch_name
}
:
#{
remote_branch
}
"
)
end
end
end
...
...
qa/qa/factory/resource/branch.rb
View file @
a10d8adf
...
...
@@ -39,7 +39,9 @@ module QA
resource
.
project
=
project
resource
.
file_name
=
'README.md'
resource
.
commit_message
=
'Add readme'
resource
.
branch_name
=
"master:
#{
@branch_name
}
"
resource
.
branch_name
=
'master'
resource
.
new_branch
=
false
resource
.
remote_branch
=
@branch_name
end
Page
::
Project
::
Show
.
act
{
wait_for_push
}
...
...
qa/qa/git/location.rb
View file @
a10d8adf
...
...
@@ -14,7 +14,7 @@ module QA
def
initialize
(
git_uri
)
@git_uri
=
git_uri
@uri
=
if
git_uri
.
start_with?
(
'ssh://'
)
if
git_uri
=~
%r{
\A
(?:ssh|http|https)://}
URI
.
parse
(
git_uri
)
else
*
rest
,
path
=
git_uri
.
split
(
':'
)
...
...
qa/qa/git/repository.rb
View file @
a10d8adf
...
...
@@ -15,8 +15,7 @@ module QA
end
end
def
location
=
(
address
)
@location
=
address
def
uri
=
(
address
)
@uri
=
URI
(
address
)
end
...
...
qa/qa/specs/features/repository/clone_spec.rb
View file @
a10d8adf
...
...
@@ -4,7 +4,7 @@ module QA
given
(
:location
)
do
Page
::
Project
::
Show
.
act
do
choose_repository_clone_http
repository_location
.
git_uri
repository_location
end
end
...
...
@@ -18,7 +18,7 @@ module QA
end
Git
::
Repository
.
perform
do
|
repository
|
repository
.
location
=
location
repository
.
uri
=
location
.
uri
repository
.
use_default_credentials
repository
.
act
do
...
...
@@ -33,7 +33,7 @@ module QA
scenario
'user performs a deep clone'
do
Git
::
Repository
.
perform
do
|
repository
|
repository
.
location
=
location
repository
.
uri
=
location
.
uri
repository
.
use_default_credentials
repository
.
act
{
clone
}
...
...
@@ -44,7 +44,7 @@ module QA
scenario
'user performs a shallow clone'
do
Git
::
Repository
.
perform
do
|
repository
|
repository
.
location
=
location
repository
.
uri
=
location
.
uri
repository
.
use_default_credentials
repository
.
act
{
shallow_clone
}
...
...
qa/qa/specs/features/repository/protected_branches_spec.rb
View file @
a10d8adf
...
...
@@ -42,7 +42,7 @@ module QA
project
.
visit!
Git
::
Repository
.
perform
do
|
repository
|
repository
.
location
=
location
repository
.
uri
=
location
.
uri
repository
.
use_default_credentials
repository
.
act
do
...
...
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