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, buildexecutor, filters, testdir, configuration, buildtest_system=None, rebuild=1)[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.buildsystem.scriptbuilder.ScriptBuilder
. Likewise fortype: compiler
andtype: spack
we will callbuildtest.buildsystem.compilerbuilder.CompilerBuilder
andbuildtest.buildsystem.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
buildtest_system (buildtest.system.BuildTestSystem, optional) – Instance of BuildTestSystem class
rebuild (int, optional) – Number of rebuild for test. This is specified via
buildtest build --rebuild
. Defaults to 1
- _generate_builders(self, 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_compilers(self, name, recipe)[source]¶
This method will perform regular expression with ‘name’ field in compilers section and retrieve one or more compiler that were defined in buildtest configuration. If any compilers were retrieved we return one or more builder objects that call
buildtest.buildsystem.compilerbuilder.CompilerBuilder
- _skip_tests_by_tags(self, 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>
- _skip_tests_by_type(self, recipe, name)[source]¶
This method determines if test should be skipped based on type field specified in filter field that is specified on command line via
buildtest build --filter type=<SCHEMATYPE>
- _skip_tests_run_only(self, recipe, name)[source]¶
This method will skip tests based on
run_only
field from buildspec. Checks are performed based on conditionals and if any conditional is not met we skip test.- Parameters
- Returns
False
if run_only property not specified in buildspec otherwise returnsTrue
based on following conditionTrue if there is no match with system ‘scheduler’ and one specified in buildspec
True if there is no match with user specifed by ‘user’ property and one detected by system using
os.getenv("USER")
True if there is no match with specified ‘platform’ property and one detected by system platform
True if there is no match with specified ‘linux_distro’ property and one detected by system
- Return type