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
745f0234
Commit
745f0234
authored
Feb 15, 2022
by
Desiree Chevalier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split e2e shared examples to add test case links
parent
3488a9c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
16 deletions
+24
-16
qa/qa/specs/features/ee/api/12_geo/geo_nodes_spec.rb
qa/qa/specs/features/ee/api/12_geo/geo_nodes_spec.rb
+15
-11
qa/qa/specs/features/ee/browser_ui/3_create/repository/restrict_push_protected_branch_spec.rb
..._create/repository/restrict_push_protected_branch_spec.rb
+9
-5
No files found.
qa/qa/specs/features/ee/api/12_geo/geo_nodes_spec.rb
View file @
745f0234
...
...
@@ -9,8 +9,8 @@ module QA
get_personal_access_token
end
shared_examples
'retrieving configuration about Geo nodes'
do
it
'GET /geo_nodes'
do
shared_examples
'retrieving configuration about Geo nodes'
do
|
testcase
|
it
'GET /geo_nodes'
,
testcase:
testcase
do
get
api_endpoint
(
'/geo_nodes'
)
expect_status
(
200
)
...
...
@@ -20,8 +20,10 @@ module QA
files_max_capacity: :integer
,
repos_max_capacity: :integer
,
clone_protocol: :string
,
_links: :object
)
end
end
it
'GET /geo_nodes/:id'
do
shared_examples
'retrieving configuration about Geo nodes/:id'
do
|
testcase
|
it
'GET /geo_nodes/:id'
,
testcase:
testcase
do
get
api_endpoint
(
"/geo_nodes/
#{
geo_node
[
:id
]
}
"
)
expect_status
(
200
)
...
...
@@ -29,14 +31,15 @@ module QA
end
end
describe
'
Geo Nodes API
on primary node'
,
:geo
do
describe
'on primary node'
,
:geo
do
before
(
:context
)
do
fetch_nodes
(
:geo_primary
)
end
include_examples
'retrieving configuration about Geo nodes'
do
let
(
:geo_node
)
{
@primary_node
}
end
let
(
:geo_node
)
{
@primary_node
}
include_examples
'retrieving configuration about Geo nodes'
,
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348042'
include_examples
'retrieving configuration about Geo nodes/:id'
,
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348041'
describe
'editing a Geo node'
do
it
'PUT /geo_nodes/:id for secondary node'
,
testcase:
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348043'
do
...
...
@@ -58,14 +61,15 @@ module QA
end
end
describe
'
Geo Nodes API
on secondary node'
,
:geo
do
describe
'on secondary node'
,
:geo
do
before
(
:context
)
do
fetch_nodes
(
:geo_secondary
)
end
include_examples
'retrieving configuration about Geo nodes'
do
let
(
:geo_node
)
{
@nodes
.
first
}
end
let
(
:geo_node
)
{
@nodes
.
first
}
include_examples
'retrieving configuration about Geo nodes'
,
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348044'
include_examples
'retrieving configuration about Geo nodes/:id'
,
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348045'
end
def
api_endpoint
(
endpoint
)
...
...
qa/qa/specs/features/ee/browser_ui/3_create/repository/restrict_push_protected_branch_spec.rb
View file @
745f0234
...
...
@@ -8,14 +8,16 @@ module QA
let
(
:branch_name
)
{
'protected-branch'
}
let
(
:commit_message
)
{
'Protected push commit message'
}
shared_examples
'
only user with access pushes and merges'
do
it
'u
nselected maintainer user fails to push'
do
shared_examples
'
unselected maintainer'
do
|
testcase
|
it
'u
ser fails to push'
,
testcase:
testcase
do
expect
{
push_new_file
(
branch_name
,
as_user:
user_maintainer
)
}.
to
raise_error
(
QA
::
Support
::
Run
::
CommandError
,
/You are not allowed to push code to protected branches on this project\.([\s\S]+)\[remote rejected\]
#{
branch_name
}
->
#{
branch_name
}
\(pre-receive hook declined\)/
)
end
end
it
'selected developer user pushes and merges'
do
shared_examples
'selected developer'
do
|
testcase
|
it
'user pushes and merges'
,
testcase:
testcase
do
push
=
push_new_file
(
branch_name
,
as_user:
user_developer
)
expect
(
push
.
output
).
to
match
(
/To create a merge request for protected-branch, visit/
)
...
...
@@ -59,7 +61,8 @@ module QA
end
end
it_behaves_like
'only user with access pushes and merges'
it_behaves_like
'unselected maintainer'
,
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347775'
it_behaves_like
'selected developer'
,
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347774'
end
context
'when only one group is allowed to merge and push to a protected branch'
do
...
...
@@ -96,7 +99,8 @@ module QA
end
end
it_behaves_like
'only user with access pushes and merges'
it_behaves_like
'unselected maintainer'
,
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347772'
it_behaves_like
'selected developer'
,
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347773'
end
def
login
(
as_user:
Runtime
::
User
)
...
...
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