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
b49e7966
Commit
b49e7966
authored
Mar 21, 2017
by
Rydkin Maxim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor spec
parent
d2f2168b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
spec/services/ci/create_pipeline_service_spec.rb
spec/services/ci/create_pipeline_service_spec.rb
+7
-10
No files found.
spec/services/ci/create_pipeline_service_spec.rb
View file @
b49e7966
...
...
@@ -47,31 +47,28 @@ describe Ci::CreatePipelineService, services: true do
pipeline
pipeline_on_previous_commit
expect
(
pipeline
.
reload
)
.
to
have_attributes
(
status:
'pending'
,
auto_canceled_by_id:
nil
)
expect
(
pipeline
.
reload
).
to
have_attributes
(
status:
'pending'
,
auto_canceled_by_id:
nil
)
end
it
'auto cancel pending non-HEAD pipelines'
do
p
ending_pipeline
=
p
ipeline_on_previous_commit
pipeline_on_previous_commit
pipeline
expect
(
p
ending_pipeline
.
reload
).
to
have_attributes
(
status:
'canceled'
,
auto_canceled_by_id:
pipeline
.
id
)
expect
(
p
ipeline_on_previous_commit
.
reload
).
to
have_attributes
(
status:
'canceled'
,
auto_canceled_by_id:
pipeline
.
id
)
end
it
'does not cancel running outdated pipelines'
do
running_pipeline
=
pipeline_on_previous_commit
running_pipeline
.
run
pipeline_on_previous_commit
.
run
execute_service
expect
(
running_pipeline
.
reload
).
to
have_attributes
(
status:
'running'
,
auto_canceled_by_id:
nil
)
expect
(
pipeline_on_previous_commit
.
reload
).
to
have_attributes
(
status:
'running'
,
auto_canceled_by_id:
nil
)
end
it
'cancel created outdated pipelines'
do
created_pipeline
=
pipeline_on_previous_commit
created_pipeline
.
update
(
status:
'created'
)
pipeline_on_previous_commit
.
update
(
status:
'created'
)
pipeline
expect
(
created_pipeline
.
reload
).
to
have_attributes
(
status:
'canceled'
,
auto_canceled_by_id:
pipeline
.
id
)
expect
(
pipeline_on_previous_commit
.
reload
).
to
have_attributes
(
status:
'canceled'
,
auto_canceled_by_id:
pipeline
.
id
)
end
it
'does not cancel pipelines from the other branches'
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