Mailinglist Archive: opensuse-factory (607 mails)

< Previous Next >
[opensuse-factory] Using YAML Merge Keys in Job templates
Hello,

you might know already that you can use openQA job templates to directly specify settings for a test.
See Marius' E-Mail https://lists.opensuse.org/opensuse-factory/2020-01/msg00246.html

In YAML, you can use anchors/aliases to reuse a mapping in several places.

We now switched to a new YAML module (YAML::PP) which also allows "YAML Merge Keys", that allow to reuse a mapping, and add other keys to it.

```
scenarios:
arch:
- jobname:
machine: ...
settings: &common
FOO: a
BAR: b
- jobname2:
machine: ...
settings:
<<: *common
FOO: other value # overrides the value from *common
BAZ: c
```

The location of the `<<` key is not important, it will always be overriden by keys explicitly defined in the mapping. So it should be always on top for readability.

For a full example and documentation on which values take precedence, see http://open.qa/docs/#_yaml_merge_keys


With that change, we are also completely compatible to YAML 1.2, while the previous YAML module only implemented a subset/mixture of 1.1 and 1.2.

To get an overview which values are special and need quoting in YAML 1.2, we added a table here:
http://open.qa/docs/#_general_yaml_documentation

Feel free to ask any questions!

cheers,
tina & tools team
--
To unsubscribe, e-mail: opensuse-factory+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-factory+owner@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages