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
99f24557
Commit
99f24557
authored
Aug 26, 2019
by
Sean Carroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds project changelog
parent
03ff8139
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
ee/changelogs/unreleased/12996-cancel-redundant-pipelines.yml
...hangelogs/unreleased/12996-cancel-redundant-pipelines.yml
+5
-0
ee/spec/services/merge_trains/refresh_merge_request_service_spec.rb
...rvices/merge_trains/refresh_merge_request_service_spec.rb
+11
-3
No files found.
ee/changelogs/unreleased/12996-cancel-redundant-pipelines.yml
0 → 100644
View file @
99f24557
---
title
:
Cancel redundant merge train pipelines
merge_request
:
15450
author
:
type
:
added
ee/spec/services/merge_trains/refresh_merge_request_service_spec.rb
View file @
99f24557
...
...
@@ -40,7 +40,7 @@ describe MergeTrains::RefreshMergeRequestService do
it
do
expect_next_instance_of
(
MergeTrains
::
CreatePipelineService
,
project
,
maintainer
)
do
|
pipeline_service
|
allow
(
pipeline_service
).
to
receive
(
:execute
)
{
{
status: :success
,
pipeline:
pipeline
}
}
allow
(
pipeline_service
).
to
receive
(
:execute
)
{
{
status: :success
,
pipeline:
create
(
:ci_pipeline
)
}
}
expect
(
pipeline_service
).
to
receive
(
:execute
).
with
(
merge_request
,
previous_ref
)
end
...
...
@@ -60,6 +60,12 @@ describe MergeTrains::RefreshMergeRequestService do
end
end
shared_examples_for
'cancels the old pipeline for merge train'
do
it
do
expect
{
subject
}.
to
change
{
pipeline
.
reload
.
status
}.
to
(
'canceled'
)
end
end
context
'when merge train project configuration is disabled'
do
before
do
project
.
update!
(
merge_trains_enabled:
false
)
...
...
@@ -137,7 +143,7 @@ describe MergeTrains::RefreshMergeRequestService do
end
context
'when pipeline for merge train is running'
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
:running
,
target_sha:
previous_ref_sha
,
source_sha:
merge_request
.
diff_head_sha
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
:running
,
:with_job
,
target_sha:
previous_ref_sha
,
source_sha:
merge_request
.
diff_head_sha
)
}
let
(
:previous_ref_sha
)
{
project
.
repository
.
commit
(
'refs/heads/master'
).
sha
}
before
do
...
...
@@ -151,12 +157,14 @@ describe MergeTrains::RefreshMergeRequestService do
context
'when the pipeline is stale'
do
let
(
:previous_ref_sha
)
{
project
.
repository
.
commits
(
'refs/heads/master'
,
limit:
2
).
last
.
sha
}
it_behaves_like
'cancels the old pipeline for merge train'
it_behaves_like
'creates a pipeline for merge train'
end
context
'when the pipeline is reuired to be recreated'
do
context
'when the pipeline is re
q
uired to be recreated'
do
let
(
:require_recreate
)
{
true
}
it_behaves_like
'cancels the old pipeline for merge train'
it_behaves_like
'creates a pipeline for merge train'
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