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
Tatuya Kamada
gitlab-ce
Commits
a9ec4ec0
Commit
a9ec4ec0
authored
Dec 13, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make build retryable only if complete and executed
parent
5f590a71
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
9 deletions
+32
-9
app/models/ci/build.rb
app/models/ci/build.rb
+2
-1
spec/models/build_spec.rb
spec/models/build_spec.rb
+30
-8
No files found.
app/models/ci/build.rb
View file @
a9ec4ec0
...
...
@@ -134,7 +134,8 @@ module Ci
end
def
retryable?
project
.
builds_enabled?
&&
commands
.
present?
&&
complete?
project
.
builds_enabled?
&&
commands
.
present?
&&
(
success?
||
failed?
)
end
def
retried?
...
...
spec/models/build_spec.rb
View file @
a9ec4ec0
...
...
@@ -900,20 +900,42 @@ describe Ci::Build, models: true do
end
describe
'#retryable?'
do
context
'when build is running'
do
before
do
build
.
run!
subject
{
build
}
context
'when build is retryable'
do
context
'when build is successful'
do
before
do
build
.
success!
end
it
{
is_expected
.
to
be_retryable
}
end
it
{
expect
(
build
).
not_to
be_retryable
}
context
'when build is failed'
do
before
do
build
.
drop!
end
it
{
is_expected
.
to
be_retryable
}
end
end
context
'when build is finished'
do
before
do
build
.
success!
context
'when build is not retryable'
do
context
'when build is running'
do
before
do
build
.
run!
end
it
{
is_expected
.
not_to
be_retryable
}
end
it
{
expect
(
build
).
to
be_retryable
}
context
'when build is skipped'
do
before
do
build
.
skip!
end
it
{
is_expected
.
not_to
be_retryable
}
end
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