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, strict=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

_get_compiler_variables()[source]
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.

_get_container_command()[source]

This method is responsible for generating container command for docker, podman, or singularity. This method will return a list of commands to launch container. This method is called when ‘container’ property is defined in buildspec.