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
e569481a
Commit
e569481a
authored
Apr 15, 2021
by
Mark Lapierre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add transient bug version of MWPS test
parent
9c35c043
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
23 deletions
+37
-23
qa/qa/specs/features/browser_ui/3_create/merge_request/merge_when_pipeline_succeeds_spec.rb
...create/merge_request/merge_when_pipeline_succeeds_spec.rb
+37
-23
No files found.
qa/qa/specs/features/browser_ui/3_create/merge_request/merge_when_pipeline_succeeds_spec.rb
View file @
e569481a
...
...
@@ -29,7 +29,7 @@ module QA
content:
<<~
EOF
test:
tags: ["runner-for-
#{
project
.
name
}
"]
script: sleep
5
script: sleep
10
only:
- merge_requests
EOF
...
...
@@ -47,36 +47,50 @@ module QA
end
it
'merges when pipeline succeeds'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1684'
do
branch_name
=
"merge-request-test-
#{
SecureRandom
.
hex
(
8
)
}
"
verify_merge_when_pipeline_succeeds
end
# Create a branch that will be merged into the default branch
Resource
::
Repository
::
ProjectPush
.
fabricate!
do
|
project_push
|
project_push
.
project
=
project
project_push
.
new_branch
=
true
project_push
.
branch_name
=
branch_name
project_push
.
file_name
=
"file-
#{
SecureRandom
.
hex
(
8
)
}
.txt"
it
'reliably merges when pipeline succeeds'
,
:transient
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1684'
do
verify_merge_when_pipeline_succeeds
(
repeat:
Runtime
::
Env
.
transient_trials
)
do
|
i
|
QA
::
Runtime
::
Logger
.
info
(
"Transient bug test - Trial
#{
i
}
"
)
end
end
# Create a merge request to merge the branch we just created
merge_request
=
Resource
::
MergeRequest
.
fabricate_via_api!
do
|
merge_request
|
merge_request
.
project
=
project
merge_request
.
source_branch
=
branch_name
merge_request
.
no_preparation
=
true
end
def
verify_merge_when_pipeline_succeeds
(
repeat:
1
)
repeat
.
times
do
|
i
|
yield
i
if
block_given?
merge_request
.
visit!
branch_name
=
"merge-request-test-
#{
SecureRandom
.
hex
(
8
)
}
"
Page
::
MergeRequest
::
Show
.
perform
do
|
mr
|
mr
.
merge_when_pipeline_succeeds!
# Create a branch that will be merged into the default branch
Resource
::
Repository
::
ProjectPush
.
fabricate!
do
|
project_push
|
project_push
.
project
=
project
project_push
.
new_branch
=
true
project_push
.
branch_name
=
branch_name
project_push
.
file_name
=
"file-
#{
SecureRandom
.
hex
(
8
)
}
.txt"
end
Support
::
Waiter
.
wait_until
(
sleep_interval:
5
)
do
merge_request
=
merge_request
.
reload!
merge_request
.
state
==
'merged'
# Create a merge request to merge the branch we just created
merge_request
=
Resource
::
MergeRequest
.
fabricate_via_api!
do
|
merge_request
|
merge_request
.
project
=
project
merge_request
.
source_branch
=
branch_name
merge_request
.
no_preparation
=
true
end
aggregate_failures
do
expect
(
merge_request
.
merge_when_pipeline_succeeds
).
to
be_truthy
expect
(
mr
.
merged?
).
to
be_truthy
,
"Expected content 'The changes were merged' but it did not appear."
merge_request
.
visit!
Page
::
MergeRequest
::
Show
.
perform
do
|
mr
|
mr
.
merge_when_pipeline_succeeds!
Support
::
Waiter
.
wait_until
(
sleep_interval:
5
)
do
merge_request
=
merge_request
.
reload!
merge_request
.
state
==
'merged'
end
aggregate_failures
do
expect
(
merge_request
.
merge_when_pipeline_succeeds
).
to
be_truthy
expect
(
mr
.
merged?
).
to
be_truthy
,
"Expected content 'The changes were merged' but it did not appear."
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