buildtest.builders.script
Module Contents
Classes
This is a subclass of BuilderBase used for building test that uses |
- class buildtest.builders.script.ScriptBuilder(name, recipe, buildspec, executor, buildexecutor, configuration, testdir=None, numprocs=None, numnodes=None, compiler=None)[source]
Bases:
buildtest.builders.base.BuilderBase
This is a subclass of BuilderBase used for building test that uses
type: script
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.
- type = 'script'
- write_python_script()[source]
This method is used for writing python script when
shell: python
is set. The content fromrun
section is added into a python script. The file is written to run directory and we simply invoke python script by runningpython script.py
- generate_script()[source]
This method builds the content of the test script which will return a list of shell commands that will be written to file.
A typical test will contain: shebang line, job directives, environment variables and variable declaration, and content of
run
property. Forshell: python
we write a python script and return immediately. The variables, environment section are not applicable for python scripts- Returns:
List of shell commands that will be written to file