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
7699975e
Commit
7699975e
authored
May 18, 2021
by
Tiffany Rea
Committed by
Dan Davison
May 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
E2E test user cancels MR in merge trains doesn't create To-Do item
parent
cbd76096
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
39 deletions
+65
-39
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_enabled.vue
...widget/components/states/mr_widget_auto_merge_enabled.vue
+1
-0
qa/qa/page/merge_request/show.rb
qa/qa/page/merge_request/show.rb
+8
-0
qa/qa/specs/features/ee/browser_ui/4_verify/cancelling_merge_request_in_merge_train_spec.rb
.../4_verify/cancelling_merge_request_in_merge_train_spec.rb
+54
-39
spec/frontend/vue_mr_widget/components/states/__snapshots__/mr_widget_auto_merge_enabled_spec.js.snap
...s/__snapshots__/mr_widget_auto_merge_enabled_spec.js.snap
+2
-0
No files found.
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_enabled.vue
View file @
7699975e
...
...
@@ -169,6 +169,7 @@ export default {
role=
"button"
href=
"#"
class=
"btn btn-sm btn-default js-cancel-auto-merge"
data-qa-selector=
"cancel_auto_merge_button"
data-testid=
"cancelAutomaticMergeButton"
@
click.prevent=
"cancelAutomaticMerge"
>
...
...
qa/qa/page/merge_request/show.rb
View file @
7699975e
...
...
@@ -119,6 +119,10 @@ module QA
element
:commit_with_custom_message_button
end
view
'app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_enabled.vue'
do
element
:cancel_auto_merge_button
end
def
start_review
click_element
(
:start_review_button
)
...
...
@@ -385,6 +389,10 @@ module QA
click_element
(
:revert_button
,
Page
::
Component
::
CommitModal
)
click_element
(
:submit_commit_button
)
end
def
cancel_auto_merge!
click_element
(
:cancel_auto_merge_button
)
end
end
end
end
...
...
qa/qa/specs/features/ee/browser_ui/4_verify/
system_cancels_merge_request_in_merge_trains
_spec.rb
→
qa/qa/specs/features/ee/browser_ui/4_verify/
cancelling_merge_request_in_merge_train
_spec.rb
View file @
7699975e
...
...
@@ -4,28 +4,24 @@ require 'faker'
module
QA
RSpec
.
describe
'Verify'
do
describe
'Merge train'
,
:runner
,
:requires_admin
,
quarantine:
{
issue:
'https://gitlab.com/gitlab-org/gitlab/-/issues/324122'
,
type: :bug
}
do
let
(
:file_name
)
{
Faker
::
Lorem
.
word
}
let
(
:mr_title
)
{
Faker
::
Lorem
.
sentence
}
let
(
:executor
)
{
"qa-runner-
#{
Faker
::
Alphanumeric
.
alphanumeric
(
8
)
}
"
}
describe
'Cancelling merge request in merge train'
,
:runner
,
:requires_admin
do
before
(
:all
)
do
executor
=
"qa-runner-
#{
Faker
::
Alphanumeric
.
alphanumeric
(
8
)
}
"
@file_name
=
Faker
::
File
.
unique
.
file_name
@admin_api_client
=
Runtime
::
API
::
Client
.
as_admin
let
(
:project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
@project
=
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'pipeline-for-merge-train'
end
end
let!
(
:runner
)
do
Resource
::
Runner
.
fabricate_via_api!
do
|
runner
|
runner
.
project
=
project
@runner
=
Resource
::
Runner
.
fabricate_via_api!
do
|
runner
|
runner
.
project
=
@project
runner
.
name
=
executor
runner
.
tags
=
[
executor
]
end
end
let!
(
:original_files
)
do
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
commit
.
project
=
project
commit
.
project
=
@
project
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
add_files
(
[
...
...
@@ -43,42 +39,44 @@ module QA
YAML
},
{
file_path:
file_name
,
file_path:
@
file_name
,
content:
Faker
::
Lorem
.
sentence
}
]
)
end
end
let
(
:user
)
do
Resource
::
User
.
fabricate_via_api!
do
|
resource
|
resource
.
api_client
=
admin_api_client
end
Flow
::
Login
.
sign_in
@project
.
visit!
Flow
::
MergeRequest
.
enable_merge_trains
end
let
(
:user_api_client
)
{
Runtime
::
API
::
Client
.
new
(
:gitlab
,
user:
user
)
}
let
(
:admin_api_client
)
{
Runtime
::
API
::
Client
.
as_admin
}
after
(
:all
)
do
@runner
.
remove_via_api!
@project
.
remove_via_api!
end
before
do
Runtime
::
Feature
.
enable
(
:invite_members_group_modal
,
project:
project
)
@mr_title
=
Faker
::
Lorem
.
sentence
Flow
::
Login
.
sign_in
project
.
visit!
Flow
::
MergeRequest
.
enable_merge_trains
project
.
add_member
(
user
,
Resource
::
Members
::
AccessLevel
::
MAINTAINER
)
@user
=
Resource
::
User
.
fabricate_via_api!
do
|
resource
|
resource
.
api_client
=
@admin_api_client
end
@user_api_client
=
Runtime
::
API
::
Client
.
new
(
:gitlab
,
user:
@user
)
@project
.
add_member
(
@user
,
Resource
::
Members
::
AccessLevel
::
MAINTAINER
)
merge_request
=
Resource
::
MergeRequest
.
fabricate_via_api!
do
|
merge_request
|
merge_request
.
api_client
=
user_api_client
merge_request
.
title
=
mr_title
merge_request
.
project
=
project
merge_request
.
api_client
=
@
user_api_client
merge_request
.
title
=
@
mr_title
merge_request
.
project
=
@
project
merge_request
.
description
=
Faker
::
Lorem
.
sentence
merge_request
.
target_new_branch
=
false
merge_request
.
file_name
=
file_name
merge_request
.
file_name
=
@
file_name
merge_request
.
file_content
=
Faker
::
Lorem
.
sentence
end
Flow
::
Login
.
sign_in
(
as:
user
)
Flow
::
Login
.
sign_in
(
as:
@
user
)
merge_request
.
visit!
Page
::
MergeRequest
::
Show
.
perform
do
|
show
|
...
...
@@ -88,22 +86,20 @@ module QA
end
after
do
runner
.
remove_via_api!
user
.
remove_via_api!
project
.
remove_via_api!
@user
.
remove_via_api!
end
context
'when system cancels
a merge request'
do
context
'when system cancels
the merge request'
,
quarantine:
{
issue:
'https://gitlab.com/gitlab-org/gitlab/-/issues/324122'
,
type: :bug
}
do
it
'creates a TODO task'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1741'
do
# Create a merge conflict
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
commit
.
api_client
=
user_api_client
commit
.
project
=
project
commit
.
api_client
=
@
user_api_client
commit
.
project
=
@
project
commit
.
commit_message
=
'changing text file'
commit
.
update_files
(
[
{
file_path:
file_name
,
file_path:
@
file_name
,
content:
'Has to be different than before.'
}
]
...
...
@@ -111,7 +107,7 @@ module QA
end
Page
::
MergeRequest
::
Show
.
perform
do
|
show
|
show
.
wait_until
(
max_duration:
90
,
reload:
false
)
{
show
.
has_content?
(
'removed this merge request from the merge train'
)
}
expect
(
show
).
to
have_system_note
(
'removed this merge request from the merge train'
)
end
Page
::
Main
::
Menu
.
perform
do
|
main
|
...
...
@@ -125,6 +121,25 @@ module QA
end
end
end
context
'when user cancels the merge request'
do
it
'does not create a TODO task'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1044'
do
# Manually removes merge request from the train
Page
::
MergeRequest
::
Show
.
perform
do
|
show
|
show
.
cancel_auto_merge!
expect
(
show
).
to
have_system_note
(
'removed this merge request from the merge train'
)
end
Page
::
Main
::
Menu
.
perform
do
|
main
|
main
.
go_to_page_by_shortcut
(
:todos_shortcut_button
)
end
Page
::
Dashboard
::
Todos
.
perform
do
|
todos
|
expect
(
todos
).
not_to
have_todo_list
,
'This user should not have any to-do item but found at least one!'
end
end
end
end
end
end
spec/frontend/vue_mr_widget/components/states/__snapshots__/mr_widget_auto_merge_enabled_spec.js.snap
View file @
7699975e
...
...
@@ -40,6 +40,7 @@ exports[`MRWidgetAutoMergeEnabled when graphql is disabled template should have
<a
class="btn btn-sm btn-default js-cancel-auto-merge"
data-qa-selector="cancel_auto_merge_button"
data-testid="cancelAutomaticMergeButton"
href="#"
role="button"
...
...
@@ -132,6 +133,7 @@ exports[`MRWidgetAutoMergeEnabled when graphql is enabled template should have c
<a
class="btn btn-sm btn-default js-cancel-auto-merge"
data-qa-selector="cancel_auto_merge_button"
data-testid="cancelAutomaticMergeButton"
href="#"
role="button"
...
...
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