polaris.Task

class polaris.Task(component, name, subdir=None, indir=None)[source]

The base class for tasks—such as a decomposition, threading or restart test—that are made up of one or more steps

Variables:
  • name (str) – the name of the task

  • component (polaris.Component) – The component the task belongs to

  • steps (dict) – A dictionary of steps in the task with step names as keys

  • step_symlinks (dict) – A dictionary of symlink paths within the test case’s work directory to shared steps outside the test case

  • steps_to_run (list) – A list of the steps to run when run() gets called. This list includes all steps by default but can be replaced with a list of only those tasks that should run by default if some steps are optional and should be run manually by the user.

  • subdir (str) – the subdirectory for the task

  • path (str) – the path within the base work directory of the task, made up of component and the task’s subdir

  • config (polaris.config.PolarisConfigParser) – Configuration options for this task, possibly shared with other tasks and steps

  • config_filename (str) – The filename or symlink within the task where config is written to during setup and read from during run

  • work_dir (str) – The task’s work directory, defined during setup as the combination of base_work_dir and path

  • base_work_dir (str) – The base work directory

  • stdout_logger (logging.Logger) – A logger for output from the task that goes to stdout regardless of whether logger is a log file or stdout

  • logger (logging.Logger) – A logger for output from the task

  • log_filename (str) – At run time, the name of a log file where output/errors from the task are being logged, or None if output is to stdout/stderr

  • new_step_log_file (bool) – Whether to create a new log file for each step or to log output to a common log file for the whole task. The latter is used when running the task as part of a suite

__init__(component, name, subdir=None, indir=None)[source]

Create a new task

Parameters:
  • component (polaris.Component) – the component that this task belongs to

  • name (str) – the name of the task

  • subdir (str, optional) –

    the subdirectory for the task. If neither this nor indir

    are provided, the directory is the name

  • indir (str, optional) – the directory the task is in, to which name will be appended

Methods

__init__(component, name[, subdir, indir])

Create a new task

add_step([step, subdir, symlink, run_by_default])

Add a step to the task and component (if not already present)

configure()

Modify the configuration options for this task.

remove_step(step)

Remove the given step from this task and the component

set_shared_config(config[, link])

Replace the task's config parser with the shared config parser