Test Series

Series are a collection of test runs.

class pavilion.series.TestSeries(pav_cfg, tests=None, _id=None, series_config=None, dep_graph=None, outfile: TextIO = <_io.StringIO object>, errfile: TextIO = <_io.StringIO object>)

Bases: object

Series are a well defined collection of tests, potentially with relationships, skip conditions, and other features by test set.

LOGGER_FMT = 'series({})'
WAIT_INTERVAL = 1
add_tests(test_objs)

Adds tests to existing series. :param test_objs: List of test objects :return: None

cancel_series()

Goes through all test objects assigned to series and cancels tests that haven’t been completed.

create_dependency_graph() → Optional[Dict[KT, VT]]

Create the dependency graph. Order is either explicit (through before and after) or implicit through the ‘ordered’ option.

create_set_graph()

Create doubly linked list of TestSets and applies hosts and modes to them

classmethod from_id(pav_cfg, sid: str, outfile: TextIO = <_io.StringIO object>, errfile: TextIO = <_io.StringIO object>)

Load a series object from the given id, along with all of its associated tests.

Raises:TestSeriesError – From invalid series id or path.
get_currently_running()

Returns list of tests that have states of either SCHEDULED or RUNNING.

static get_pgid(pav_cfg, id_)

Returns pgid of series if it exists.

load_dep_graph()

Load a series object from the given id, along with the config and dependency tree.

run_series()

Runs series.

run_series_background()

Run pav _series in background using subprocess module.

run_tests(wait: Union[None, int] = None, tests: List[pavilion.test_run.TestRun] = None) → int

Run the tests for this test series.

Parameters:
  • wait (int) – Wait this long for a test to start before exiting.
  • tests – Manually specified list of tests to run. Defaults to the series’ test list.
Returns:

A return code based on the success of this action.

save_dep_graph()

Write dependency tree and config in series dir

Returns:
save_series_config() → None

Saves series config to a file.

series_test_handler(finished, started, waiting)

Loops through all current sets, calls necessary functions, and updates lists as necessary.

sid

Return the series id as a string, with an ‘s’ in the front to differentiate it from test ids.

classmethod sid_to_id(sid: str) → int

Convert a sid string to a numeric series id.

Raises:TestSeriesError – On an invalid sid.
timestamp

Return the unix timestamp for this series, based on the last modified date for the test directory.

update_finished_list(finished, started)

Updates finished and started lists if necessary.

class pavilion.series.TestSet(pav_cfg, name: str, tests: List[str], modes: List[str], host: str, only_if: Dict[str, List[str]], not_if: Dict[str, List[str]], series_obj: pavilion.series.TestSeries)

Bases: object

Class describes a set of tests.

LOGGER_FMT = 'series({})'
is_done()

Returns True if all the tests in the set are completed.

kill_set()

Goes through all the tests assigned to set and kills tests.

run_set()

Runs tests in set.

skip_set()

Procedure to skip tests.

test_wait(simul)

Returns when the number of tests running is less than or equal to the number of tests that can run or be scheduled simultaneously, if the simultaneous parameter is set.