Commit 7ca36859 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'test-gitlab-ci-ymls' into 'master'

Test templates and GitLabCI parser againts each other

## What does this MR do?

Test the available templates against the preprocessor and vice versa

## Are there points in the code the reviewer needs to double check?

The dynamic creation of tests seems a little hacked. Is there a cleaner way?

## Does this MR meet the acceptance criteria?

- [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added -- Seems unneeded
- [x] All builds are passing
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] Branch has no merge conflicts with `master` (if you do - rebase it please)

See merge request !4898
parents 8267b4ae cf8a19b1
...@@ -1206,5 +1206,17 @@ EOT ...@@ -1206,5 +1206,17 @@ EOT
end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: dependencies parameter should be an array of strings") end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: dependencies parameter should be an array of strings")
end end
end end
describe "Validate configuration templates" do
templates = Dir.glob("#{Rails.root.join('vendor/gitlab-ci-yml')}/**/*.gitlab-ci.yml")
templates.each do |file|
it "does not return errors for #{file}" do
file = File.read(file)
expect { GitlabCiYamlProcessor.new(file) }.not_to raise_error
end
end
end
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