[FEATURE]: Ability to load specs in spack schema
Closed this issue · 0 comments
Please describe your feature
We should add support for spack load
this can be useful for running tests or simply loading the package once its installed. We should add the following. Let's say if we were to test m4
we can load the package prior to testing it. This could be done as follows
buildspecs:
spack_load_example:
type: spack
executor: generic.local.bash
description: "Run spack load for m4 package and run tests"
tags: [spack]
spack:
root: $HOME/spack
load:
options: '--only package'
specs: [m4]
test:
run:
specs: ['m4']
results:
option: "-l"
In the above test, the load
refers to spack load
and options
refer to options that can be passed to spack load
command with a list of specs defined by specs
property. The below command would translate to spack load --only package m4
load:
options: '--only package'
specs: [m4]
The order of where spack load
command must be written in test must be done after spack install
(if present) and before spack test
(if present).
TODO
- Update spack schema to add support for
load
- Add implementation of emitting
spack load
command in https://github.com/buildtesters/buildtest/blob/devel/buildtest/builders/spack.py. This would be in methodgenerate_script
seebuildtest/buildtest/builders/spack.py
Line 48 in 58f91fd
- Add example buildspec to demonstrate this example in https://github.com/buildtesters/buildtest/tree/devel/examples/spack
- Add valid and invalid example for testing with regression test see https://github.com/buildtesters/buildtest/tree/devel/buildtest/schemas/examples/spack.schema.json please put a valid and invalid example so we can test this works during regression test
- Add documentation in https://buildtest.readthedocs.io/en/devel/buildspecs/spack.html add this at bottom of file
Suggest potential solution
No response
Additional Information
No response
Post question in Slack
- I agree that I posted my question in slack before creating this issue
Is there an existing issue
- I confirm there is no existing issue for this issue