BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
008f22cd
Commit
008f22cd
authored
Feb 09, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pipeline specs related to canceling builds
parent
a70a83cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
commit_status.rb
app/models/commit_status.rb
+1
-1
pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+10
-2
No files found.
app/models/commit_status.rb
View file @
008f22cd
...
@@ -65,8 +65,8 @@ class CommitStatus < ActiveRecord::Base
...
@@ -65,8 +65,8 @@ class CommitStatus < ActiveRecord::Base
end
end
event
:cancel
do
event
:cancel
do
transition
[
:pending
,
:running
]
=>
:canceled
transition
[
:created
]
=>
:skipped
transition
[
:created
]
=>
:skipped
transition
[
:pending
,
:running
]
=>
:canceled
end
end
before_transition
created:
[
:pending
,
:running
]
do
|
commit_status
|
before_transition
created:
[
:pending
,
:running
]
do
|
commit_status
|
...
...
spec/models/ci/pipeline_spec.rb
View file @
008f22cd
...
@@ -503,7 +503,9 @@ describe Ci::Pipeline, models: true do
...
@@ -503,7 +503,9 @@ describe Ci::Pipeline, models: true do
end
end
describe
'#status'
do
describe
'#status'
do
let!
(
:build
)
{
create
(
:ci_build
,
:created
,
pipeline:
pipeline
,
name:
'test'
)
}
let
(
:build
)
do
create
(
:ci_build
,
:created
,
pipeline:
pipeline
,
name:
'test'
)
end
subject
{
pipeline
.
reload
.
status
}
subject
{
pipeline
.
reload
.
status
}
...
@@ -545,7 +547,13 @@ describe Ci::Pipeline, models: true do
...
@@ -545,7 +547,13 @@ describe Ci::Pipeline, models: true do
build
.
cancel
build
.
cancel
end
end
it
{
is_expected
.
to
eq
(
'canceled'
)
}
context
'when build is pending'
do
let
(
:build
)
do
create
(
:ci_build
,
:pending
,
pipeline:
pipeline
)
end
it
{
is_expected
.
to
eq
(
'canceled'
)
}
end
end
end
context
'on failure and build retry'
do
context
'on failure and build retry'
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