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
d8f98900
Commit
d8f98900
authored
Aug 14, 2019
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce the CE/EE diff under qa/
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
94cf543f
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
112 additions
and
45 deletions
+112
-45
qa/qa/page/main/login.rb
qa/qa/page/main/login.rb
+20
-11
qa/qa/page/project/issue/new.rb
qa/qa/page/project/issue/new.rb
+2
-2
qa/qa/page/project/issue/show.rb
qa/qa/page/project/issue/show.rb
+1
-1
qa/qa/page/project/menu.rb
qa/qa/page/project/menu.rb
+1
-1
qa/qa/resource/merge_request.rb
qa/qa/resource/merge_request.rb
+24
-1
qa/qa/scenario/test/sanity/selectors.rb
qa/qa/scenario/test/sanity/selectors.rb
+5
-3
qa/qa/service/omnibus.rb
qa/qa/service/omnibus.rb
+6
-5
qa/qa/specs/features/browser_ui/3_create/merge_request/view_merge_request_diff_patch_spec.rb
...reate/merge_request/view_merge_request_diff_patch_spec.rb
+9
-4
qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb
...er_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb
+7
-16
qa/qa/vendor/saml_idp/page/login.rb
qa/qa/vendor/saml_idp/page/login.rb
+8
-0
qa/spec/resource/repository/push_spec.rb
qa/spec/resource/repository/push_spec.rb
+5
-1
qa/spec/runtime/env_spec.rb
qa/spec/runtime/env_spec.rb
+24
-0
No files found.
qa/qa/page/main/login.rb
View file @
d8f98900
...
...
@@ -52,13 +52,11 @@ module QA
raise
NotImplementedError
if
Runtime
::
User
.
ldap_user?
&&
user
&
.
credentials_given?
if
Runtime
::
User
.
ldap_user?
sign_in_using_ldap_credentials
sign_in_using_ldap_credentials
(
user
||
Runtime
::
User
)
else
sign_in_using_gitlab_credentials
(
user
||
Runtime
::
User
)
end
end
Page
::
Main
::
Menu
.
perform
(
&
:has_personal_area?
)
end
def
sign_in_using_admin_credentials
...
...
@@ -76,6 +74,25 @@ module QA
Page
::
Main
::
Menu
.
perform
(
&
:has_personal_area?
)
end
def
sign_in_using_ldap_credentials
(
user
)
# Log out if already logged in
Page
::
Main
::
Menu
.
perform
do
|
menu
|
menu
.
sign_out
if
menu
.
has_personal_area?
(
wait:
0
)
end
using_wait_time
0
do
set_initial_password_if_present
switch_to_ldap_tab
fill_element
:username_field
,
user
.
ldap_username
fill_element
:password_field
,
user
.
ldap_password
click_element
:sign_in_button
end
Page
::
Main
::
Menu
.
perform
(
&
:has_personal_area?
)
end
def
self
.
path
'/users/sign_in'
end
...
...
@@ -133,14 +150,6 @@ module QA
private
def
sign_in_using_ldap_credentials
switch_to_ldap_tab
fill_element
:username_field
,
Runtime
::
User
.
ldap_username
fill_element
:password_field
,
Runtime
::
User
.
ldap_password
click_element
:sign_in_button
end
def
sign_in_using_gitlab_credentials
(
user
)
switch_to_sign_in_tab
if
has_sign_in_tab?
switch_to_standard_tab
if
has_standard_tab?
...
...
qa/qa/page/project/issue/new.rb
View file @
d8f98900
...
...
@@ -6,7 +6,7 @@ module QA
module
Issue
class
New
<
Page
::
Base
view
'app/views/shared/issuable/_form.html.haml'
do
element
:
submit_issue_button
,
'form.submit "Submit'
# rubocop:disable QA/ElementWithPatter
n
element
:
issuable_create_butto
n
end
view
'app/views/shared/issuable/form/_title.html.haml'
do
...
...
@@ -26,7 +26,7 @@ module QA
end
def
create_new_issue
click_
on
'Submit issue'
click_
element
:issuable_create_button
,
Page
::
Project
::
Issue
::
Show
end
end
end
...
...
qa/qa/page/project/issue/show.rb
View file @
d8f98900
...
...
@@ -14,7 +14,7 @@ module QA
end
view
'app/assets/javascripts/notes/components/discussion_filter.vue'
do
element
:discussion_filter
element
:discussion_filter
,
required:
true
element
:filter_options
end
...
...
qa/qa/page/project/menu.rb
View file @
d8f98900
...
...
@@ -5,7 +5,7 @@ module QA
module
Project
class
Menu
<
Page
::
Base
include
SubMenus
::
Common
include
SubMenus
::
Project
include
SubMenus
::
CiCd
include
SubMenus
::
Issues
include
SubMenus
::
Operations
...
...
qa/qa/resource/merge_request.rb
View file @
d8f98900
...
...
@@ -5,7 +5,8 @@ require 'securerandom'
module
QA
module
Resource
class
MergeRequest
<
Base
attr_accessor
:title
,
attr_accessor
:id
,
:title
,
:description
,
:source_branch
,
:target_branch
,
...
...
@@ -74,6 +75,28 @@ module QA
page
.
create_merge_request
end
end
def
fabricate_via_api!
populate
(
:target
,
:source
)
super
end
def
api_get_path
"/projects/
#{
project
.
id
}
/merge_requests/
#{
id
}
"
end
def
api_post_path
"/projects/
#{
project
.
id
}
/merge_requests"
end
def
api_post_body
{
description:
@description
,
source_branch:
@source_branch
,
target_branch:
@target_branch
,
title:
@title
}
end
end
end
end
qa/qa/scenario/test/sanity/selectors.rb
View file @
d8f98900
...
...
@@ -7,11 +7,13 @@ module QA
class
Selectors
<
Scenario
::
Template
include
Scenario
::
Bootable
PAGES
=
[
QA
::
Page
].
freeze
def
pages
@pages
||=
[
QA
::
Page
]
end
def
perform
(
*
)
validators
=
PAGES
.
map
do
|
pages
|
Page
::
Validator
.
new
(
page
s
)
validators
=
pages
.
map
do
|
page
|
Page
::
Validator
.
new
(
page
)
end
validators
.
flat_map
(
&
:errors
).
tap
do
|
errors
|
...
...
qa/qa/service/omnibus.rb
View file @
d8f98900
...
...
@@ -11,11 +11,12 @@ module QA
end
def
gitlab_ctl
(
command
,
input:
nil
)
if
input
.
nil?
shell
"docker exec
#{
@name
}
gitlab-ctl
#{
command
}
"
else
shell
"docker exec
#{
@name
}
bash -c '
#{
input
}
| gitlab-ctl
#{
command
}
'"
docker_exec
(
"gitlab-ctl
#{
command
}
"
,
input:
input
)
end
def
docker_exec
(
command
,
input:
nil
)
command
=
"
#{
input
}
|
#{
command
}
"
if
input
shell
"docker exec
#{
@name
}
bash -c '
#{
command
}
'"
end
end
end
...
...
qa/qa/specs/features/browser_ui/3_create/merge_request/view_merge_request_diff_patch_spec.rb
View file @
d8f98900
...
...
@@ -7,13 +7,18 @@ module QA
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
perform
(
&
:sign_in_using_credentials
)
@merge_request
=
Resource
::
MergeRequest
.
fabricate!
do
|
merge_request
|
project
=
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'project'
end
@merge_request
=
Resource
::
MergeRequest
.
fabricate_via_api!
do
|
merge_request
|
merge_request
.
project
=
project
merge_request
.
title
=
'This is a merge request'
merge_request
.
description
=
'
F
or downloading patches and diffs'
merge_request
.
description
=
'
... f
or downloading patches and diffs'
end
end
it
'
user views
merge request email patches'
do
it
'
views the
merge request email patches'
do
@merge_request
.
visit!
Page
::
MergeRequest
::
Show
.
perform
(
&
:view_email_patches
)
...
...
@@ -22,7 +27,7 @@ module QA
expect
(
page
).
to
have_content
(
'diff --git a/added_file.txt b/added_file.txt'
)
end
it
'
user views
merge request plain diff'
do
it
'
views the
merge request plain diff'
do
@merge_request
.
visit!
Page
::
MergeRequest
::
Show
.
perform
(
&
:view_plain_diff
)
...
...
qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb
View file @
d8f98900
...
...
@@ -3,36 +3,29 @@
require
'digest/sha1'
module
QA
# Failure issue: https://gitlab.com/gitlab-org/quality/nightly/issues/70
context
'Release'
,
:docker
,
:quarantine
do
context
'Release'
,
:docker
do
describe
'Git clone using a deploy key'
do
def
login
before
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
perform
(
&
:sign_in_using_credentials
)
end
before
(
:all
)
do
login
@runner_name
=
"qa-runner-
#{
Time
.
now
.
to_i
}
"
@project
=
Resource
::
Project
.
fabricate!
do
|
resource
|
@project
=
Resource
::
Project
.
fabricate
_via_api
!
do
|
resource
|
resource
.
name
=
'deploy-key-clone-project'
end
@repository_location
=
@project
.
repository_ssh_location
Resource
::
Runner
.
fabricate!
do
|
resource
|
Resource
::
Runner
.
fabricate
_via_browser_ui
!
do
|
resource
|
resource
.
project
=
@project
resource
.
name
=
@runner_name
resource
.
tags
=
%w[qa docker]
resource
.
image
=
'gitlab/gitlab-runner:ubuntu'
end
Page
::
Main
::
Menu
.
perform
(
&
:sign_out
)
end
after
(
:all
)
do
after
do
Service
::
Runner
.
new
(
@runner_name
).
remove!
end
...
...
@@ -46,9 +39,7 @@ module QA
it
"user sets up a deploy key with
#{
key_class
}
(
#{
bits
}
) to clone code using pipelines"
do
key
=
key_class
.
new
(
*
bits
)
login
Resource
::
DeployKey
.
fabricate!
do
|
resource
|
Resource
::
DeployKey
.
fabricate_via_browser_ui!
do
|
resource
|
resource
.
project
=
@project
resource
.
title
=
"deploy key
#{
key
.
name
}
(
#{
key
.
bits
}
)"
resource
.
key
=
key
.
public_key
...
...
@@ -56,7 +47,7 @@ module QA
deploy_key_name
=
"DEPLOY_KEY_
#{
key
.
name
}
_
#{
key
.
bits
}
"
Resource
::
CiVariable
.
fabricate!
do
|
resource
|
Resource
::
CiVariable
.
fabricate
_via_browser_ui
!
do
|
resource
|
resource
.
project
=
@project
resource
.
key
=
deploy_key_name
resource
.
value
=
key
.
private_key
...
...
qa/qa/vendor/saml_idp/page/login.rb
View file @
d8f98900
...
...
@@ -12,6 +12,14 @@ module QA
fill_in
'password'
,
with:
'user1pass'
click_on
'Login'
end
def
login_if_required
login
if
login_required?
end
def
login_required?
page
.
has_text?
(
'Enter your username and password'
)
end
end
end
end
...
...
qa/spec/resource/repository/push_spec.rb
View file @
d8f98900
...
...
@@ -19,7 +19,11 @@ describe QA::Resource::Repository::Push do
expect
{
subject
.
files
=
[]
}.
to
raise_error
(
ArgumentError
)
end
it
'does not raise if files is an array'
do
it
'raises an error if files is not an array of hashes with :name and :content keys'
do
expect
{
subject
.
files
=
[{
foo:
'foo'
}]
}.
to
raise_error
(
ArgumentError
)
end
it
'does not raise if files is an array of hashes with :name and :content keys'
do
expect
{
subject
.
files
=
files
}.
not_to
raise_error
end
end
...
...
qa/spec/runtime/env_spec.rb
View file @
d8f98900
...
...
@@ -192,6 +192,30 @@ describe QA::Runtime::Env do
end
end
describe
'.knapsack?'
do
it
'returns true if KNAPSACK_GENERATE_REPORT is defined'
do
stub_env
(
'KNAPSACK_GENERATE_REPORT'
,
'true'
)
expect
(
described_class
.
knapsack?
).
to
be_truthy
end
it
'returns true if KNAPSACK_REPORT_PATH is defined'
do
stub_env
(
'KNAPSACK_REPORT_PATH'
,
'/a/path'
)
expect
(
described_class
.
knapsack?
).
to
be_truthy
end
it
'returns true if KNAPSACK_TEST_FILE_PATTERN is defined'
do
stub_env
(
'KNAPSACK_TEST_FILE_PATTERN'
,
'/a/**/pattern'
)
expect
(
described_class
.
knapsack?
).
to
be_truthy
end
it
'returns false if neither KNAPSACK_GENERATE_REPORT nor KNAPSACK_REPORT_PATH nor KNAPSACK_TEST_FILE_PATTERN are defined'
do
expect
(
described_class
.
knapsack?
).
to
be_falsey
end
end
describe
'.require_github_access_token!'
do
it
'raises ArgumentError if GITHUB_ACCESS_TOKEN is not defined'
do
stub_env
(
'GITHUB_ACCESS_TOKEN'
,
nil
)
...
...
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