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
7c5c1e92
Commit
7c5c1e92
authored
Oct 18, 2018
by
Markus Doits
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix wrong retry error messages
parent
b7ee04d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
lib/gitlab/ci/config/entry/retry.rb
lib/gitlab/ci/config/entry/retry.rb
+12
-0
spec/lib/gitlab/ci/config/entry/retry_spec.rb
spec/lib/gitlab/ci/config/entry/retry_spec.rb
+2
-2
No files found.
lib/gitlab/ci/config/entry/retry.rb
View file @
7c5c1e92
...
@@ -17,6 +17,10 @@ module Gitlab
...
@@ -17,6 +17,10 @@ module Gitlab
greater_than_or_equal_to:
0
,
greater_than_or_equal_to:
0
,
less_than_or_equal_to:
2
}
less_than_or_equal_to:
2
}
end
end
def
location
'retry'
end
end
end
class
FullRetry
<
Entry
::
Node
class
FullRetry
<
Entry
::
Node
...
@@ -47,12 +51,20 @@ module Gitlab
...
@@ -47,12 +51,20 @@ module Gitlab
def
self
.
possible_retry_when_values
def
self
.
possible_retry_when_values
@possible_retry_when_values
||=
Gitlab
::
Ci
::
Status
::
Build
::
Failed
.
reasons
.
keys
.
map
(
&
:to_s
)
+
[
'always'
]
@possible_retry_when_values
||=
Gitlab
::
Ci
::
Status
::
Build
::
Failed
.
reasons
.
keys
.
map
(
&
:to_s
)
+
[
'always'
]
end
end
def
location
'retry'
end
end
end
class
UnknownStrategy
<
Entry
::
Node
class
UnknownStrategy
<
Entry
::
Node
def
errors
def
errors
[
"
#{
location
}
has to be either an integer or a hash"
]
[
"
#{
location
}
has to be either an integer or a hash"
]
end
end
def
location
'retry config'
end
end
end
def
self
.
default
def
self
.
default
...
...
spec/lib/gitlab/ci/config/entry/retry_spec.rb
View file @
7c5c1e92
...
@@ -78,7 +78,7 @@ describe Gitlab::Ci::Config::Entry::Retry do
...
@@ -78,7 +78,7 @@ describe Gitlab::Ci::Config::Entry::Retry do
it
'returns error about invalid type'
do
it
'returns error about invalid type'
do
expect
(
entry
).
not_to
be_valid
expect
(
entry
).
not_to
be_valid
expect
(
entry
.
errors
).
to
include
'
job retry should be a hash or an integer
'
expect
(
entry
.
errors
).
to
include
'
retry config has to be either an integer or a hash
'
end
end
end
end
...
@@ -98,7 +98,7 @@ describe Gitlab::Ci::Config::Entry::Retry do
...
@@ -98,7 +98,7 @@ describe Gitlab::Ci::Config::Entry::Retry do
it
'returns error about wrong value'
do
it
'returns error about wrong value'
do
expect
(
entry
).
not_to
be_valid
expect
(
entry
).
not_to
be_valid
expect
(
entry
.
errors
).
to
include
'
job retry should be a hash or an integer
'
expect
(
entry
.
errors
).
to
include
'
retry config has to be either an integer or a hash
'
end
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