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
e03c0453
Commit
e03c0453
authored
Mar 26, 2021
by
Furkan Ayhan
Committed by
Sanad Liaquat
Mar 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add E2E test for trigger matrix
parent
740626ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
127 additions
and
5 deletions
+127
-5
qa/qa/page/project/pipeline/show.rb
qa/qa/page/project/pipeline/show.rb
+15
-5
qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_matrix_spec.rb
...tures/browser_ui/4_verify/pipeline/trigger_matrix_spec.rb
+112
-0
No files found.
qa/qa/page/project/pipeline/show.rb
View file @
e03c0453
...
@@ -68,20 +68,30 @@ module QA
...
@@ -68,20 +68,30 @@ module QA
end
end
end
end
def
has_child_pipeline?
def
has_child_pipeline?
(
title:
nil
)
has_element?
:child_pipeline
title
?
find_child_pipeline_by_title
(
title
)
:
has_element?
(
:child_pipeline
)
end
end
def
has_no_child_pipeline?
def
has_no_child_pipeline?
has_no_element?
:child_pipeline
has_no_element?
(
:child_pipeline
)
end
end
def
click_job
(
job_name
)
def
click_job
(
job_name
)
click_element
(
:job_link
,
Project
::
Job
::
Show
,
text:
job_name
)
click_element
(
:job_link
,
Project
::
Job
::
Show
,
text:
job_name
)
end
end
def
expand_child_pipeline
def
child_pipelines
within_element
(
:child_pipeline
)
do
all_elements
(
:child_pipeline
,
minimum:
1
)
end
def
find_child_pipeline_by_title
(
title
)
child_pipelines
.
find
{
|
pipeline
|
pipeline
[
:title
].
include?
(
title
)
}
end
def
expand_child_pipeline
(
title:
nil
)
child_pipeline
=
title
?
find_child_pipeline_by_title
(
title
)
:
child_pipelines
.
first
within_element_by_index
(
:child_pipeline
,
child_pipelines
.
index
(
child_pipeline
))
do
click_element
(
:expand_pipeline_button
)
click_element
(
:expand_pipeline_button
)
end
end
end
end
...
...
qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_matrix_spec.rb
0 → 100644
View file @
e03c0453
# frozen_string_literal: true
require
'faker'
module
QA
RSpec
.
describe
'Verify'
,
:runner
do
describe
'Trigger matrix'
do
let
(
:executor
)
{
"qa-runner-
#{
Faker
::
Alphanumeric
.
alphanumeric
(
8
)
}
"
}
let
(
:project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'project-with-pipeline'
end
end
let!
(
:runner
)
do
Resource
::
Runner
.
fabricate!
do
|
runner
|
runner
.
project
=
project
runner
.
name
=
executor
runner
.
tags
=
[
executor
]
end
end
before
do
Flow
::
Login
.
sign_in
add_ci_files
project
.
visit!
Flow
::
Pipeline
.
visit_latest_pipeline
(
pipeline_condition:
'succeeded'
)
end
after
do
runner
.
remove_via_api!
project
.
remove_via_api!
end
it
'creates 2 trigger jobs and passes corresponding matrix variables'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1732'
do
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
parent_pipeline
|
trigger_title1
=
'deploy: [ovh, monitoring]'
trigger_title2
=
'deploy: [ovh, app]'
aggregate_failures
'Creates two child pipelines'
do
expect
(
parent_pipeline
).
to
have_child_pipeline
(
title:
trigger_title1
)
expect
(
parent_pipeline
).
to
have_child_pipeline
(
title:
trigger_title2
)
end
# Only check output of one of the child pipelines, should be sufficient
parent_pipeline
.
expand_child_pipeline
(
title:
trigger_title1
)
parent_pipeline
.
click_job
(
'test_vars'
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
show
|
Support
::
Waiter
.
wait_until
{
show
.
successful?
}
aggregate_failures
'Job output has the correct variables'
do
expect
(
show
.
output
).
to
have_content
(
'ovh'
)
expect
(
show
.
output
).
to
have_content
(
'monitoring'
)
end
end
end
private
def
add_ci_files
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
commit
.
project
=
project
commit
.
commit_message
=
'Add parent and child pipelines CI files.'
commit
.
add_files
(
[
child_ci_file
,
parent_ci_file
]
)
end
end
def
parent_ci_file
{
file_path:
'.gitlab-ci.yml'
,
content:
<<~
YAML
test:
stage: test
script: echo test
tags: [
#{
executor
}
]
deploy:
stage: deploy
trigger:
include: child.yml
parallel:
matrix:
- PROVIDER: ovh
STACK: [monitoring, app]
YAML
}
end
def
child_ci_file
{
file_path:
'child.yml'
,
content:
<<~
YAML
test_vars:
script:
- echo $PROVIDER
- echo $STACK
tags: [
#{
executor
}
]
YAML
}
end
end
end
end
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