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
Show 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 {
...
@@ -169,6 +169,7 @@ export default {
role=
"button"
role=
"button"
href=
"#"
href=
"#"
class=
"btn btn-sm btn-default js-cancel-auto-merge"
class=
"btn btn-sm btn-default js-cancel-auto-merge"
data-qa-selector=
"cancel_auto_merge_button"
data-testid=
"cancelAutomaticMergeButton"
data-testid=
"cancelAutomaticMergeButton"
@
click.prevent=
"cancelAutomaticMerge"
@
click.prevent=
"cancelAutomaticMerge"
>
>
...
...
qa/qa/page/merge_request/show.rb
View file @
7699975e
...
@@ -119,6 +119,10 @@ module QA
...
@@ -119,6 +119,10 @@ module QA
element
:commit_with_custom_message_button
element
:commit_with_custom_message_button
end
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
def
start_review
click_element
(
:start_review_button
)
click_element
(
:start_review_button
)
...
@@ -385,6 +389,10 @@ module QA
...
@@ -385,6 +389,10 @@ module QA
click_element
(
:revert_button
,
Page
::
Component
::
CommitModal
)
click_element
(
:revert_button
,
Page
::
Component
::
CommitModal
)
click_element
(
:submit_commit_button
)
click_element
(
:submit_commit_button
)
end
end
def
cancel_auto_merge!
click_element
(
:cancel_auto_merge_button
)
end
end
end
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'
...
@@ -4,28 +4,24 @@ require 'faker'
module
QA
module
QA
RSpec
.
describe
'Verify'
do
RSpec
.
describe
'Verify'
do
describe
'Merge train'
,
:runner
,
:requires_admin
,
quarantine:
{
issue:
'https://gitlab.com/gitlab-org/gitlab/-/issues/324122'
,
type: :bug
}
do
describe
'Cancelling merge request in merge train'
,
:runner
,
:requires_admin
do
let
(
:file_name
)
{
Faker
::
Lorem
.
word
}
before
(
:all
)
do
let
(
:mr_title
)
{
Faker
::
Lorem
.
sentence
}
executor
=
"qa-runner-
#{
Faker
::
Alphanumeric
.
alphanumeric
(
8
)
}
"
let
(
: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
@project
=
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'pipeline-for-merge-train'
project
.
name
=
'pipeline-for-merge-train'
end
end
end
let!
(
:runner
)
do
@runner
=
Resource
::
Runner
.
fabricate_via_api!
do
|
runner
|
Resource
::
Runner
.
fabricate_via_api!
do
|
runner
|
runner
.
project
=
@project
runner
.
project
=
project
runner
.
name
=
executor
runner
.
name
=
executor
runner
.
tags
=
[
executor
]
runner
.
tags
=
[
executor
]
end
end
end
let!
(
:original_files
)
do
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
commit
.
project
=
project
commit
.
project
=
@
project
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
add_files
(
commit
.
add_files
(
[
[
...
@@ -43,42 +39,44 @@ module QA
...
@@ -43,42 +39,44 @@ module QA
YAML
YAML
},
},
{
{
file_path:
file_name
,
file_path:
@
file_name
,
content:
Faker
::
Lorem
.
sentence
content:
Faker
::
Lorem
.
sentence
}
}
]
]
)
)
end
end
end
let
(
:user
)
do
Flow
::
Login
.
sign_in
Resource
::
User
.
fabricate_via_api!
do
|
resource
|
@project
.
visit!
resource
.
api_client
=
admin_api_client
Flow
::
MergeRequest
.
enable_merge_trains
end
end
end
let
(
:user_api_client
)
{
Runtime
::
API
::
Client
.
new
(
:gitlab
,
user:
user
)
}
after
(
:all
)
do
let
(
:admin_api_client
)
{
Runtime
::
API
::
Client
.
as_admin
}
@runner
.
remove_via_api!
@project
.
remove_via_api!
end
before
do
before
do
Runtime
::
Feature
.
enable
(
:invite_members_group_modal
,
project:
project
)
@mr_title
=
Faker
::
Lorem
.
sentence
Flow
::
Login
.
sign_in
@user
=
Resource
::
User
.
fabricate_via_api!
do
|
resource
|
project
.
visit!
resource
.
api_client
=
@admin_api_client
Flow
::
MergeRequest
.
enable_merge_trains
end
project
.
add_member
(
user
,
Resource
::
Members
::
AccessLevel
::
MAINTAINER
)
@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
=
Resource
::
MergeRequest
.
fabricate_via_api!
do
|
merge_request
|
merge_request
.
api_client
=
user_api_client
merge_request
.
api_client
=
@
user_api_client
merge_request
.
title
=
mr_title
merge_request
.
title
=
@
mr_title
merge_request
.
project
=
project
merge_request
.
project
=
@
project
merge_request
.
description
=
Faker
::
Lorem
.
sentence
merge_request
.
description
=
Faker
::
Lorem
.
sentence
merge_request
.
target_new_branch
=
false
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
merge_request
.
file_content
=
Faker
::
Lorem
.
sentence
end
end
Flow
::
Login
.
sign_in
(
as:
user
)
Flow
::
Login
.
sign_in
(
as:
@
user
)
merge_request
.
visit!
merge_request
.
visit!
Page
::
MergeRequest
::
Show
.
perform
do
|
show
|
Page
::
MergeRequest
::
Show
.
perform
do
|
show
|
...
@@ -88,22 +86,20 @@ module QA
...
@@ -88,22 +86,20 @@ module QA
end
end
after
do
after
do
runner
.
remove_via_api!
@user
.
remove_via_api!
user
.
remove_via_api!
project
.
remove_via_api!
end
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
it
'creates a TODO task'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1741'
do
# Create a merge conflict
# Create a merge conflict
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
commit
.
api_client
=
user_api_client
commit
.
api_client
=
@
user_api_client
commit
.
project
=
project
commit
.
project
=
@
project
commit
.
commit_message
=
'changing text file'
commit
.
commit_message
=
'changing text file'
commit
.
update_files
(
commit
.
update_files
(
[
[
{
{
file_path:
file_name
,
file_path:
@
file_name
,
content:
'Has to be different than before.'
content:
'Has to be different than before.'
}
}
]
]
...
@@ -111,7 +107,7 @@ module QA
...
@@ -111,7 +107,7 @@ module QA
end
end
Page
::
MergeRequest
::
Show
.
perform
do
|
show
|
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
end
Page
::
Main
::
Menu
.
perform
do
|
main
|
Page
::
Main
::
Menu
.
perform
do
|
main
|
...
@@ -125,6 +121,25 @@ module QA
...
@@ -125,6 +121,25 @@ module QA
end
end
end
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
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
...
@@ -40,6 +40,7 @@ exports[`MRWidgetAutoMergeEnabled when graphql is disabled template should have
<a
<a
class="btn btn-sm btn-default js-cancel-auto-merge"
class="btn btn-sm btn-default js-cancel-auto-merge"
data-qa-selector="cancel_auto_merge_button"
data-testid="cancelAutomaticMergeButton"
data-testid="cancelAutomaticMergeButton"
href="#"
href="#"
role="button"
role="button"
...
@@ -132,6 +133,7 @@ exports[`MRWidgetAutoMergeEnabled when graphql is enabled template should have c
...
@@ -132,6 +133,7 @@ exports[`MRWidgetAutoMergeEnabled when graphql is enabled template should have c
<a
<a
class="btn btn-sm btn-default js-cancel-auto-merge"
class="btn btn-sm btn-default js-cancel-auto-merge"
data-qa-selector="cancel_auto_merge_button"
data-testid="cancelAutomaticMergeButton"
data-testid="cancelAutomaticMergeButton"
href="#"
href="#"
role="button"
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