- class compass.TestCase(test_group, name, subdir=None)¶
The base class for test cases—such as a decomposition, threading or restart test—that are made up of one or more steps
name (str) – the name of the test case
test_group (compass.TestGroup) – The test group the test case belongs to
mpas_core (compass.MpasCore) – The MPAS core the test group belongs to
steps (dict) – A dictionary of steps in the test case with step names as keys
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 tests that should run by default if some steps are optional and should be run manually by the user.
subdir (str) – the subdirectory for the test case
path (str) – the path within the base work directory of the test case, made up of
test_group, and the test case’s
config (configparser.ConfigParser) – Configuration options for this test case, a combination of the defaults for the machine, core and configuration
config_filename (str) – The local name of the config file that
confighas been written to during setup and read from during run
work_dir (str) – The test case’s work directory, defined during setup as the combination of
base_work_dir (str) – The base work directory
baseline_dir (str, optional) – Location of the same test case within the basesline work directory, for use in comparing variables and timers
stdout_logger (logging.Logger) – A logger for output from the test case that goes to stdout regardless of whether
loggeris a log file or stdout
logger (logging.Logger) – A logger for output from the test case
log_filename (str) – At run time, the name of a log file where output/errors from the test case are being logged, or
Noneif 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 test case. The latter is used when running the test case as part of a test suite
validation (dict) – A dictionary with the status of internal and baseline comparisons, used by the
compassframework to determine whether the test case passed or failed internal and baseline validation.
- __init__(test_group, name, subdir=None)¶
Create a new test case
__init__(test_group, name[, subdir])
Create a new test case
Add a step to the test case
Check the test case's "validation" dictionary to see if validation failed.
Modify the configuration options for this test case.
Run each step of the test case.
Test cases can override this method to perform validation of variables and timers