To support the creation and maintenance of multiple very similar tests, I suggest implementing buildspec templates which allow changes to the buildspec contents using input parameters. They might look something like this:
buildspecs:
<TEST>_e4stestsuite_e4s_21.05:
type: script
executor: cori.slurm.haswell_premium
description: Run <TEST> from E4S Testsuite for e4s/21.05
tags: [e4s]
sbatch: ["-t 30", "-N 1"]
run: |
module swap intel intel/19.1.3.304
module load e4s/21.05
git clone https://github.com/E4S-Project/testsuite
cd testsuite
sh test-all.sh --color-off validation_tests/<TEST> --print-logs --settings settings.cori.sh
And could be run like this:
buildtest build -b e4s_testsuite.yml --parameters "TEST=adios2;PARAMETER2=another-parameter"
So a dictionary type argument is passed to the build command and string substitution takes place before the template spec is interpreted.
Considerations:
- It would be preferable to keep template specs valid yaml files. That might require extending the schema so only values need to be parameterized (i.e. adding a
name: "string" field to buildspec)
- A basic implementation of this could work by setting environment variables for the test's run environment. This approach could control the contents of the run script, but other elements (test name and description) would have to be set separately.
- A method of running a test template multiple times iterating over a list of input parameters is necessary to employ this feature effectively in CI.
- I recommend a hard distinction between full buildspecs and template specs. Running a regular buildspec with parametric input results in a failure, running a template without parametric input results in a failure. There should be filename conventions to distinguish templates from regular buildspecs.
Post question in Slack
Is there an existing issue
To support the creation and maintenance of multiple very similar tests, I suggest implementing buildspec templates which allow changes to the buildspec contents using input parameters. They might look something like this:
And could be run like this:
buildtest build -b e4s_testsuite.yml --parameters "TEST=adios2;PARAMETER2=another-parameter"So a dictionary type argument is passed to the build command and string substitution takes place before the template spec is interpreted.
Considerations:
name: "string"field to buildspec)Post question in Slack
Is there an existing issue