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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
0683f8d0
Commit
0683f8d0
authored
Mar 03, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pipeline retry specs for optional blocking actions
parent
14351f97
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
spec/services/ci/retry_pipeline_service_spec.rb
spec/services/ci/retry_pipeline_service_spec.rb
+7
-8
No files found.
spec/services/ci/retry_pipeline_service_spec.rb
View file @
0683f8d0
...
...
@@ -92,7 +92,7 @@ describe Ci::RetryPipelineService, '#execute', :services do
context
'when there is a canceled manual action in first stage'
do
before
do
create_build
(
'rspec 1'
,
:failed
,
0
)
create_build
(
'staging'
,
:canceled
,
0
,
:manual
)
create_build
(
'staging'
,
:canceled
,
0
,
when: :manual
,
allow_failure:
true
)
create_build
(
'rspec 2'
,
:canceled
,
1
)
end
...
...
@@ -109,8 +109,8 @@ describe Ci::RetryPipelineService, '#execute', :services do
context
'when there is a skipped manual action in last stage'
do
before
do
create_build
(
'rspec 1'
,
:canceled
,
0
)
create_build
(
'rspec 2'
,
:skipped
,
0
,
:manual
)
create_build
(
'staging'
,
:skipped
,
1
,
:manual
)
create_build
(
'rspec 2'
,
:skipped
,
0
,
when: :manual
,
allow_failure:
true
)
create_build
(
'staging'
,
:skipped
,
1
,
when: :manual
,
allow_failure:
true
)
end
it
'retries canceled job and reprocesses manual actions'
do
...
...
@@ -126,7 +126,7 @@ describe Ci::RetryPipelineService, '#execute', :services do
context
'when there is a created manual action in the last stage'
do
before
do
create_build
(
'rspec 1'
,
:canceled
,
0
)
create_build
(
'staging'
,
:created
,
1
,
:manual
)
create_build
(
'staging'
,
:created
,
1
,
when: :manual
,
allow_failure:
true
)
end
it
'retries canceled job and does not update the manual action'
do
...
...
@@ -141,7 +141,7 @@ describe Ci::RetryPipelineService, '#execute', :services do
context
'when there is a created manual action in the first stage'
do
before
do
create_build
(
'rspec 1'
,
:canceled
,
0
)
create_build
(
'staging'
,
:created
,
0
,
:manual
)
create_build
(
'staging'
,
:created
,
0
,
when: :manual
,
allow_failure:
true
)
end
it
'retries canceled job and skipps the manual action'
do
...
...
@@ -183,13 +183,12 @@ describe Ci::RetryPipelineService, '#execute', :services do
statuses
.
latest
.
find_by
(
name:
name
)
end
def
create_build
(
name
,
status
,
stage_num
,
on
=
'on_success'
)
def
create_build
(
name
,
status
,
stage_num
,
**
opts
)
create
(
:ci_build
,
name:
name
,
status:
status
,
stage:
"stage_
#{
stage_num
}
"
,
stage_idx:
stage_num
,
when:
on
,
pipeline:
pipeline
)
do
|
build
|
pipeline:
pipeline
,
**
opts
)
do
|
build
|
pipeline
.
update_status
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