buildtest.buildsystem.builders
This module implements the Builder class that is responsible for getting builders
from a buildspec file. The Builder class is invoked once buildspec file has
parsed validation via buildtest.buildsystem.parser.BuildspecParser
.
Module Contents
Classes
The Builder class creates builder objects based on parsed buildspecs. |
- class buildtest.buildsystem.builders.Builder(bp, buildtest_compilers, buildexecutor, filters, testdir, configuration, rebuild=1, numprocs=None, numnodes=None, executor_type=None, exclude_tags=None, strict=None, display=None)[source]
The Builder class creates builder objects based on parsed buildspecs.
The builder class is created based on the ‘type’ field in the test. If test contains
type: script
we will create builder by callingbuildtest.builders.script.ScriptBuilder
. Likewise fortype: spack
we will callbuildtest.builders.spack.SpackBuilder
.Based on a loaded Buildspec file, return the correct builder for each based on the type. Each type is associated with a known Builder class.
- Parameters:
bp (buildtest.buildsystem.parser.BuildspecParser) – Instance of BuildspecParser class
buildexecutor (buildtest.executors.setup.BuildExecutor) – Instance of BuildExecutor class
filters (dict) – List of filter fields specified via
buildtest build --filter
for filtering teststestdir (str) – Test directory where tests will be written which could be specified via
buildtest build --testdir
or configuration fileconfiguration (buildtest.config.SiteConfiguration) – Instance of SiteConfiguration class
rebuild (int, option) – Number of rebuild for test. This is specified via
buildtest build --rebuild
. Defaults to 1numprocs (list, optional) – List of processor values to create builder objects specified via
buildtest build --procs
numnodes (list, optional) – List of processor values to create builder objects specified via
buildtest build --nodes
executor_type (str, optional) – Filter test by executor type (local, batch)
exclude_tags (list, optional) – List of tags to exclude tests from buildspec file
strict (bool, optional) – This is a boolean used for enable strict mode for test that will run the ‘set’ command in test.
display (list, optional) – Show content of test or output via
buildtest build --display
- filter_by_executor_type()[source]
This method will filter test by executor type when using
buildtest build --executor-type
. The filter can be made based on local or batch executors
- create_script_builders(name, recipe, executor, nodes=None, procs=None, compiler_name=None)[source]
Create builder objects by calling
buildtest.builders.script.ScriptBuilder
class.
- create_spack_builders(name, recipe, executor, nodes=None, procs=None)[source]
Create builder objects by calling
buildtest.builders.spack.SpackBuilder
class.
- generate_builders(recipe, name, compiler_name=None)[source]
This method is responsible for generating builders by applying regular expression specified by executor field in buildspec with list of executors. If their is a match we generate a builder.
- build(name, recipe)[source]
This method will generate a list of builders by invoking method
buildtest.buildsystem.builders.Builder.generate_builders()
. If compilers is specified in buildspec we will perform regular expression to search for compilers based on name and retrieve one or more compiler that were defined in buildtest configuration. If any compilers were retrieved we return one or more builder objects based on compiler name.
- _skip_tests_by_exclude_tags(recipe, name)[source]
This method determines if test should be skipped based on tag names specified in exclude field that is specified on command line via
buildtest build --exclude tags=<TAGNAME>
- _skip_tests_by_tags(recipe, name)[source]
This method determines if test should be skipped based on tag names specified in filter field that is specified on command line via
buildtest build --filter tags=<TAGNAME>