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
87221388
Commit
87221388
authored
Apr 08, 2021
by
Tiffany Rea
Committed by
Ramya Authappan
Apr 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
E2E test pipeline for group owned project subscription
parent
8f5e0fba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
105 additions
and
0 deletions
+105
-0
qa/qa/specs/features/ee/browser_ui/4_verify/pipeline_subscription_with_group_owned_project_spec.rb
...fy/pipeline_subscription_with_group_owned_project_spec.rb
+105
-0
No files found.
qa/qa/specs/features/ee/browser_ui/4_verify/pipeline_subscription_with_group_owned_project_spec.rb
0 → 100644
View file @
87221388
# frozen_string_literal: true
module
QA
RSpec
.
describe
'Verify'
do
describe
'Pipeline subscription with a group owned project'
,
:runner
do
let
(
:executor
)
{
"qa-runner-
#{
SecureRandom
.
hex
(
3
)
}
"
}
let
(
:tag_name
)
{
"awesome-tag-
#{
SecureRandom
.
hex
(
3
)
}
"
}
let
(
:upstream_project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'upstream-project-for-subscription'
project
.
description
=
'Project with CI subscription'
end
end
let
(
:downstream_project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'project-with-pipeline-subscription'
project
.
description
=
'Project with CI subscription'
end
end
let!
(
:runner
)
do
Resource
::
Runner
.
fabricate!
do
|
runner
|
runner
.
project
=
upstream_project
runner
.
token
=
upstream_project
.
group
.
sandbox
.
runners_token
runner
.
name
=
executor
runner
.
tags
=
[
executor
]
end
end
before
do
[
downstream_project
,
upstream_project
].
each
do
|
project
|
add_ci_file
(
project
)
end
Flow
::
Login
.
sign_in
downstream_project
.
visit!
EE
::
Resource
::
PipelineSubscriptions
.
fabricate_via_browser_ui!
do
|
subscription
|
subscription
.
project_path
=
upstream_project
.
path_with_namespace
end
end
after
do
[
runner
,
upstream_project
,
downstream_project
].
each
do
|
item
|
item
.
remove_via_api!
end
end
context
'when upstream project new tag pipeline finishes'
do
it
'triggers pipeline in downstream project'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1729'
do
# Downstream project should have one pipeline at this time
unless
downstream_project
.
pipelines
.
size
==
1
raise
"[ERROR] Downstream project should have 1 pipeline - pipelines count
#{
downstream_project
.
pipelines
.
size
}
"
end
Resource
::
Tag
.
fabricate_via_api!
do
|
tag
|
tag
.
project
=
upstream_project
tag
.
ref
=
upstream_project
.
default_branch
tag
.
name
=
tag_name
end
downstream_project
.
visit!
# Wait for upstream new tag pipeline to succeed
# And downstream project to have 2 pipelines
Support
::
Waiter
.
wait_until
do
new_pipeline
=
upstream_project
.
pipelines
.
find
{
|
pipeline
|
pipeline
[
:ref
]
==
tag_name
}
new_pipeline
[
:status
]
==
'success'
&&
downstream_project
.
pipelines
.
size
==
2
end
# expect new downstream pipeline to also succeed
Page
::
Project
::
Menu
.
perform
(
&
:click_ci_cd_pipelines
)
Page
::
Project
::
Pipeline
::
Index
.
perform
do
|
index
|
expect
(
index
.
wait_for_latest_pipeline_succeeded
).
to
be_truthy
,
'Downstream pipeline did not succeed as expected.'
end
end
end
private
def
add_ci_file
(
project
)
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
commit
.
project
=
project
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
add_files
(
[
{
file_path:
'.gitlab-ci.yml'
,
content:
<<~
YAML
job:
tags:
-
#{
executor
}
script:
- echo DONE!
YAML
}
]
)
end
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