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
80c463d9
Commit
80c463d9
authored
Mar 06, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend pipeline retry specs with blocking actions
parent
b782358f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
11 deletions
+50
-11
spec/services/ci/retry_pipeline_service_spec.rb
spec/services/ci/retry_pipeline_service_spec.rb
+50
-11
No files found.
spec/services/ci/retry_pipeline_service_spec.rb
View file @
80c463d9
...
...
@@ -89,6 +89,7 @@ describe Ci::RetryPipelineService, '#execute', :services do
end
context
'when pipeline contains manual actions'
do
context
'when there are optional manual actions only'
do
context
'when there is a canceled manual action in first stage'
do
before
do
create_build
(
'rspec 1'
,
:failed
,
0
)
...
...
@@ -96,7 +97,7 @@ describe Ci::RetryPipelineService, '#execute', :services do
create_build
(
'rspec 2'
,
:canceled
,
1
)
end
it
'retries build
s failed builds and marks subsequent for processing'
do
it
'retrie
s failed builds and marks subsequent for processing'
do
service
.
execute
(
pipeline
)
expect
(
build
(
'rspec 1'
)).
to
be_pending
...
...
@@ -105,6 +106,44 @@ describe Ci::RetryPipelineService, '#execute', :services do
expect
(
pipeline
.
reload
).
to
be_running
end
end
end
context
'when pipeline has blocking manual actions defined'
do
context
'when pipeline retry should enqueue builds'
do
before
do
create_build
(
'test'
,
:failed
,
0
)
create_build
(
'deploy'
,
:canceled
,
0
,
when: :manual
,
allow_failure:
false
)
create_build
(
'verify'
,
:canceled
,
1
)
end
it
'retries failed builds'
do
service
.
execute
(
pipeline
)
expect
(
build
(
'test'
)).
to
be_pending
expect
(
build
(
'deploy'
)).
to
be_manual
expect
(
build
(
'verify'
)).
to
be_created
expect
(
pipeline
.
reload
).
to
be_running
end
end
context
'when pipeline retry should block pipeline immediately'
do
before
do
create_build
(
'test'
,
:success
,
0
)
create_build
(
'deploy:1'
,
:success
,
1
,
when: :manual
,
allow_failure:
false
)
create_build
(
'deploy:2'
,
:failed
,
1
,
when: :manual
,
allow_failure:
false
)
create_build
(
'verify'
,
:canceled
,
2
)
end
it
'reprocesses blocking manual action and blocks pipeline'
do
service
.
execute
(
pipeline
)
expect
(
build
(
'deploy:1'
)).
to
be_success
expect
(
build
(
'deploy:2'
)).
to
be_manual
expect
(
build
(
'verify'
)).
to
be_created
expect
(
pipeline
.
reload
).
to
be_blocked
end
end
end
context
'when there is a skipped manual action in last stage'
do
before
do
...
...
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