Commit 8c9c3eda authored by Grzegorz Bizon's avatar Grzegorz Bizon

Prevalidate CI entries recursively on processed

parent 80587064
...@@ -31,10 +31,9 @@ module Gitlab ...@@ -31,10 +31,9 @@ module Gitlab
end end
def validate! def validate!
if @validator.valid?(:new) return unless valid?
@validator.validate(:processed)
end
@validator.validate(:processed)
@entries.each_value(&:validate!) @entries.each_value(&:validate!)
end end
......
...@@ -1065,7 +1065,7 @@ EOT ...@@ -1065,7 +1065,7 @@ EOT
end end
it "returns errors if there are no visible jobs defined" do it "returns errors if there are no visible jobs defined" do
config = YAML.dump({ before_script: ["bundle update"], '.hidden'.to_sym => {} }) config = YAML.dump({ before_script: ["bundle update"], '.hidden'.to_sym => { script: 'ls' } })
expect do expect do
GitlabCiYamlProcessor.new(config, path) GitlabCiYamlProcessor.new(config, path)
end.to raise_error(GitlabCiYamlProcessor::ValidationError, "jobs config should contain at least one visible job") end.to raise_error(GitlabCiYamlProcessor::ValidationError, "jobs config should contain at least one visible job")
......
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