Commit 7c5c1e92 authored by Markus Doits's avatar Markus Doits

fix wrong retry error messages

parent b7ee04d4
...@@ -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
......
...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment