Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Doits <markus.doits@stellenticket.de>2018-10-18 20:05:11 +0300
committerMarkus Doits <markus.doits@stellenticket.de>2018-11-07 15:04:23 +0300
commit7c5c1e9240f8ced4f569b0b97b4c87a53657fb99 (patch)
tree9c8604766bd7200c7c2bfd992152de9b72bb201b
parentb7ee04d4564deaf30cf3c8ead34701ac6d746c05 (diff)
fix wrong retry error messages
-rw-r--r--lib/gitlab/ci/config/entry/retry.rb12
-rw-r--r--spec/lib/gitlab/ci/config/entry/retry_spec.rb4
2 files changed, 14 insertions, 2 deletions
diff --git a/lib/gitlab/ci/config/entry/retry.rb b/lib/gitlab/ci/config/entry/retry.rb
index 140201447d1..1f9539dafdb 100644
--- a/lib/gitlab/ci/config/entry/retry.rb
+++ b/lib/gitlab/ci/config/entry/retry.rb
@@ -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
diff --git a/spec/lib/gitlab/ci/config/entry/retry_spec.rb b/spec/lib/gitlab/ci/config/entry/retry_spec.rb
index 17ffa51106f..cc5dfb56655 100644
--- a/spec/lib/gitlab/ci/config/entry/retry_spec.rb
+++ b/spec/lib/gitlab/ci/config/entry/retry_spec.rb
@@ -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