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
360976b9
Commit
360976b9
authored
Sep 18, 2020
by
Tiffany Rea
Committed by
Sanad Liaquat
Sep 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
E2E discussion not dropping merge trains MR
(cherry picked from commit d20eef6250476c217fd796b557f67559bb50059e)
parent
c5307cca
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
118 additions
and
1 deletion
+118
-1
app/views/projects/_merge_request_merge_checks_settings.html.haml
...s/projects/_merge_request_merge_checks_settings.html.haml
+1
-1
qa/qa/ee/page/project/settings/merge_request.rb
qa/qa/ee/page/project/settings/merge_request.rb
+5
-0
qa/qa/page/project/settings/merge_request.rb
qa/qa/page/project/settings/merge_request.rb
+9
-0
qa/qa/specs/features/ee/browser_ui/4_verify/new_discussion_not_dropping_merge_trains_mr_spec.rb
...erify/new_discussion_not_dropping_merge_trains_mr_spec.rb
+103
-0
No files found.
app/views/projects/_merge_request_merge_checks_settings.html.haml
View file @
360976b9
...
...
@@ -21,6 +21,6 @@
.text-secondary
=
s_
(
'ProjectSettings|This introduces the risk of merging changes that will not pass the pipeline.'
)
.form-check.mb-2
=
form
.
check_box
:only_allow_merge_if_all_discussions_are_resolved
,
class:
'form-check-input'
=
form
.
check_box
:only_allow_merge_if_all_discussions_are_resolved
,
class:
'form-check-input'
,
data:
{
qa_selector:
'allow_merge_if_all_discussions_are_resolved_checkbox'
}
=
form
.
label
:only_allow_merge_if_all_discussions_are_resolved
,
class:
'form-check-label'
do
=
s_
(
'ProjectSettings|All discussions must be resolved'
)
qa/qa/ee/page/project/settings/merge_request.rb
View file @
360976b9
...
...
@@ -23,6 +23,11 @@ module QA
def
click_pipelines_for_merged_results_checkbox
check_element
:merged_results_pipeline_checkbox
end
def
enable_merge_train
click_pipelines_for_merged_results_checkbox
click_save_changes
end
end
end
end
...
...
qa/qa/page/project/settings/merge_request.rb
View file @
360976b9
...
...
@@ -15,6 +15,10 @@ module QA
element
:radio_button_merge_ff
end
view
'app/views/projects/_merge_request_merge_checks_settings.html.haml'
do
element
:allow_merge_if_all_discussions_are_resolved_checkbox
end
def
click_save_changes
click_element
:save_merge_request_changes
end
...
...
@@ -23,6 +27,11 @@ module QA
click_element
:radio_button_merge_ff
click_save_changes
end
def
enable_merge_if_all_disscussions_are_resolved
click_element
:allow_merge_if_all_discussions_are_resolved_checkbox
click_save_changes
end
end
end
end
...
...
qa/qa/specs/features/ee/browser_ui/4_verify/new_discussion_not_dropping_merge_trains_mr_spec.rb
0 → 100644
View file @
360976b9
# frozen_string_literal: true
require
'faker'
module
QA
RSpec
.
describe
'Verify'
,
:docker
,
:runner
do
describe
'In merge trains'
do
context
'new thread discussion'
do
let
(
:executor
)
{
"qa-runner-
#{
Faker
::
Alphanumeric
.
alphanumeric
(
8
)
}
"
}
let!
(
:runner
)
do
Resource
::
Runner
.
fabricate!
do
|
runner
|
runner
.
project
=
project
runner
.
name
=
executor
runner
.
tags
=
[
executor
]
end
end
let
(
:project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'pipeline-for-merge-trains'
end
end
let
(
:merge_request
)
do
Resource
::
MergeRequest
.
fabricate_via_api!
do
|
merge_request
|
merge_request
.
project
=
project
merge_request
.
description
=
Faker
::
Lorem
.
sentence
merge_request
.
target_new_branch
=
false
merge_request
.
file_name
=
'custom_file.txt'
merge_request
.
file_content
=
Faker
::
Lorem
.
sentence
end
end
before
do
Flow
::
Login
.
sign_in
project
.
visit!
Page
::
Project
::
Menu
.
perform
(
&
:go_to_general_settings
)
Page
::
Project
::
Settings
::
Main
.
perform
(
&
:expand_merge_requests_settings
)
Page
::
Project
::
Settings
::
MergeRequest
.
perform
do
|
setting
|
setting
.
enable_merge_train
setting
.
enable_merge_if_all_disscussions_are_resolved
end
commit_ci_file
merge_request
.
visit!
Page
::
MergeRequest
::
Show
.
perform
do
|
show
|
show
.
has_pipeline_status?
(
'passed'
)
show
.
try_to_merge!
end
end
after
do
runner
.
remove_via_api!
end
it
'does not drop MR'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1010'
do
start_discussion
Page
::
MergeRequest
::
Show
.
perform
do
|
show
|
show
.
has_pipeline_status?
(
'passed'
)
expect
(
show
).
to
be_merged
end
end
private
def
commit_ci_file
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
test_merge_train:
tags:
-
#{
executor
}
script: echo 'OK!'
only:
- merge_requests
YAML
}
]
)
end
end
def
start_discussion
Page
::
MergeRequest
::
Show
.
perform
do
|
show
|
show
.
wait_until
(
reload:
false
)
do
show
.
has_content?
'started a merge train'
end
show
.
click_discussions_tab
show
.
start_discussion
(
Faker
::
Lorem
.
sentence
)
end
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