Improve CI editor schema specs to support global keywords on the same file
Currently the tests inside spec/frontend/editor/schema/ci/ci_schema_spec.js
that target global keywords, like workflow:
, need to have separate files for each test.
An example of this can be seen in this MR: !137815 (comment 1688720005)
The newly introduced workflow:auto_cancel:on_job_failure
setting supports multiple valid options, and since workflow
is a global keyword I had to split the test files, one for each valid option.
Proposed solution
Use a top-level YAML entry as "test name/description" and generate a .gitlab-ci.yml
contet per each one of those top level entries.
Related to the example above, the test YAML file would look like this:
# Inside spec/frontend/editor/schema/ci/yaml_tests/positive_tests/auto_cancel.yml
auto cancel pipeline on job failure all:
workflow:
auto_cancel:
on_job_failure: all
auto cancel pipeline on job failure none:
workflow:
auto_cancel:
on_job_failure: none