This method defines the Spack buildsystem for the spack package manager ( 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



This is a subclass of BuilderBase used for building test that uses type: spack in the buildspec.

class, recipe, buildspec, buildexecutor, executor, testdir=None, numprocs=None, numnodes=None)[source]


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.

  • 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 executors

  • testdir (str) – Test directory where tests are written. Must be full path on filesystem.

type = 'spack'

Method responsible for generating the content of test script for spack buildsystem


This method will return lines for generating spack test run and spack 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.

  • path (str) – Full path to root of spack directory

  • verify_spack (bool, optional) – Check for existence of spack setup script $SPACK_ROOT/share/spack/ before sourcing file. By default this check is enabled but can be disabled to allow test to run even if spack doesn’t exist on filesystem.


BuildTestError – Raise exception if root of spack doesn’t exist or we are unable to resolve path to setup script $SPACK_ROOT/share/spack/


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)


spack_env (dict) – Contains property env from buildspec dictionary