:py:mod:`buildtest.builders.spack` ================================== .. py:module:: buildtest.builders.spack .. autoapi-nested-parse:: 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 ~~~~~~~ .. autoapisummary:: buildtest.builders.spack.SpackBuilder .. py:class:: SpackBuilder(name, recipe, buildspec, buildexecutor, executor, testdir=None, numprocs=None, numnodes=None, strict=None, display=None) Bases: :py:obj:`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. :param name: Name of test in buildspec recipe :type name: str :param recipe: The loaded test section from the buildspec file :type recipe: str :param buildspec: Full path to buildspec file :type buildspec: str :param buildexecutor: An instance of BuildExecutor class used for accessing executors :type buildexecutor: :obj:`buildtest.executors.setup.BuildExecutor` :param testdir: Test directory where tests are written. Must be full path on filesystem. :type testdir: str :param display: Display content of output/error or test. :type display: list, optional .. py:attribute:: type :value: 'spack' .. py:method:: generate_script() Method responsible for generating the content of test script for spack buildsystem .. py:method:: _spack_test(spack_configuration) This method will return lines for generating ``spack test run`` and ``spack test results`` command for running tests via spack and getting results. .. py:method:: _resolve_spack_root(path, verify_spack=True) Given a path find the startup spack setup script to source. :param path: Full path to root of spack directory :type path: str :param verify_spack: Check for existence of spack setup script `$SPACK_ROOT/share/spack/setup-env.sh` 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. :type verify_spack: bool, optional :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` .. py:method:: _spack_environment(spack_env) 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) :param spack_env: Contains property ``env`` from buildspec dictionary :type spack_env: dict