Is there any option to reuse tests section across several testsuite
Hello, We're currently running quite a few unit tests in our Helm charts, and sometimes we need to run the same tests against a different combination of values defined at a testsuite level.
For example:
suite: HiveMQ Platform ConfigMap tests
templates:
- hivemq-configuration.yml
- hivemq-custom-resource.yml
release:
name: test-hivemq-platform
namespace: test-hivemq-platform-namespace
chart:
version: 0.0.1
appVersion: 1.0.0
tests:
- it: my-it-1
asserts:
...
- it: my-it-2
asserts:
...
- it: my-it-3
asserts:
...
Would be nice, if I could reuse the whole section under the tests for a different testsuite, by for example specifying a file containing the base tests set, so I don't need to copy and paste the whole section of tests for a different testsuite. Not sure if this is already available somehow?
Hello @afalhambra-hivemq
You can use yaml anchors to make reusable sections.
You can add the reusable blocks at the beginning (before the suite definition).
Have used in in several scenario's, but currently there is example in the test projects.
Greetings @quintush
Thanks @quintush for the example and reference to the YAML anchors though I am looking for a way to reuse these tests (or YAML blocks) across different test suites (or different YAML files) and I guess these YAML anchors won't work there? Not sure how feasible this could be.
Could you please point me out to the example you mentioned for using YAML anchors? Thanks again.
Related: #186