buildtest.builders.spack
This method defines the Spack buildsystem for the spack package manager (https://spack.readthedocs.io/en/latest/) by generating scripts that will do various spack operation. The SpackBuilder class will generate a test script using the schema definition ‘spack.schema.json’ that defines how buildspecs are written.
Module Contents
Classes
This is a subclass of BuilderBase used for building test that uses |
- class buildtest.builders.spack.SpackBuilder(name, recipe, buildspec, buildexecutor, executor, testdir=None, numprocs=None, numnodes=None, strict=None, display=None)[source]
Bases:
buildtest.builders.base.BuilderBase
This is a subclass of BuilderBase used for building test that uses
type: spack
in the buildspec.The BuilderBase provides common functions for any builder. The builder is an instance of BuilderBase. The initializer method will setup the builder attributes based on input test by
name
parameter.- Parameters:
name (str) – Name of test in buildspec recipe
recipe (str) – The loaded test section from the buildspec file
buildspec (str) – Full path to buildspec file
buildexecutor (
buildtest.executors.setup.BuildExecutor
) – An instance of BuildExecutor class used for accessing executorstestdir (str) – Test directory where tests are written. Must be full path on filesystem.
display (list, optional) – Display content of output/error or test.
- type = 'spack'
- generate_script()[source]
Method responsible for generating the content of test script for spack buildsystem
- _spack_test(spack_configuration)[source]
This method will return lines for generating
spack test run
andspack test results
command for running tests via spack and getting results.
- _resolve_spack_root(path, verify_spack=True)[source]
Given a path find the startup spack setup script to source.
- Parameters:
- Raises:
BuildTestError – Raise exception if root of spack doesn’t exist or we are unable to resolve path to setup script $SPACK_ROOT/share/spack/setup-env.sh
- _spack_environment(spack_env)[source]
This method is responsible for creating a spack environment, activate an existing spack environment, deactivating an existing spack environment, create a spack environment from a directory and a manifest file (spack.yaml, spack.lock)
- Parameters:
spack_env (dict) – Contains property
env
from buildspec dictionary