buildtest.builders.script

Module Contents

Classes

ScriptBuilder

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

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 executors

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

type = 'script'
resolve_compilers()[source]
write_python_script()[source]

This method is used for writing python script when shell: python is set. The content from run section is added into a python script. The file is written to run directory and we simply invoke python script by running python 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. For shell: 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