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

fix wrong retry error messages

parent b7ee04d4
......@@ -17,6 +17,10 @@ module Gitlab
greater_than_or_equal_to: 0,
less_than_or_equal_to: 2 }
end
def location
'retry'
end
end
class FullRetry < Entry::Node
......@@ -47,12 +51,20 @@ module Gitlab
def self.possible_retry_when_values
@possible_retry_when_values ||= Gitlab::Ci::Status::Build::Failed.reasons.keys.map(&:to_s) + ['always']
end
def location
'retry'
end
end
class UnknownStrategy < Entry::Node
def errors
["#{location} has to be either an integer or a hash"]
end
def location
'retry config'
end
end
def self.default
......
......@@ -78,7 +78,7 @@ describe Gitlab::Ci::Config::Entry::Retry do
it 'returns error about invalid type' do
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
......@@ -98,7 +98,7 @@ describe Gitlab::Ci::Config::Entry::Retry do
it 'returns error about wrong value' do
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
......
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