pysys.constants¶
Standard constants that are used throughout the PySys framework.
The convention is to import all contents of the module so that the constants can be referenced directly.
HOSTNAME¶
-
pysys.constants.
HOSTNAME
= 'agv-win2012.apama.com'¶ The fully qualified name of this host.
PLATFORM¶
-
pysys.constants.
PLATFORM
= 'win32'¶ OS platform - current values are:
linux
,win32
(Windows),sunos
(Solaris),darwin
(Mac). It is recommended to use standard Python functions such assys.platform
rather than this constant.
IS_WINDOWS¶
-
pysys.constants.
IS_WINDOWS
= True¶ True if this is Windows, False for other operating systems such as Unix.
PYTHON_EXE¶
-
pysys.constants.
PYTHON_EXE
= 'c:\\apama_build\\br\\rel\\10.7.2.x\\apama-lib4\\win\\amd64\\all\\python\\3.7.8\\python.exe'¶ The path to the current Python executable (=``sys.executable``).
BACKGROUND¶
-
pysys.constants.
BACKGROUND
= 10¶ Constant indicating a process is to be started asynchronously in the background.
FOREGROUND¶
-
pysys.constants.
FOREGROUND
= 11¶ Constant indicating a process is to be run synchronously in the foreground.
PASSED¶
INSPECT¶
NOTVERIFIED¶
FAILED¶
TIMEDOUT¶
DUMPEDCORE¶
BLOCKED¶
SKIPPED¶
-
pysys.constants.
SKIPPED
= SKIPPED(non-failure)¶ Non-failure test
Outcome
indicating that the test was ignored as it is not currently required to run on this platform/mode. Seepysys.basetest.BaseTest.skipTest
.
OUTCOMES¶
-
pysys.constants.
OUTCOMES
= (SKIPPED(non-failure), BLOCKED, DUMPEDCORE, TIMEDOUT, FAILED, NOTVERIFIED(non-failure), INSPECT(non-failure), PASSED(non-failure))¶ Lists all possible test outcomes, in descending order of precedence.
Non-failure test
Outcome
indicating that the test was ignored as it is not currently required to run on this platform/mode.Failure test
Outcome
indicating that something went wrong, for example an exception was raised by the testcase or a required file could not be found.Failure test
Outcome
indicating that a crash occurred, and acore
file was generated (UNIX only).Failure test
Outcome
indicating that the test timed out while performing execution or validation operations.Failure test
Outcome
indicating validation steps with a negative outcome.Non-failure test
Outcome
indicating that it was not possible to positively validate correct operation.Non-failure test
Outcome
indicating that manual inspection of the test output is required (in addition to any automated checks).Non-failure test
Outcome
indicating successful validation steps.If a test adds multiple outcomes, the outcome with highest precedence is used as the final test outcome (i.e. SKIPPED rather than FAILED, FAILED rather than PASSED etc).
Each item is an instance of
Outcome
. UseOutcome.isFailure()
to check whether a given outcome is classed as a failure for reporting purposes.
PRECEDENT¶
FAILS¶
-
pysys.constants.
FAILS
= [BLOCKED, DUMPEDCORE, TIMEDOUT, FAILED]¶ - Deprecated
To test whether a specific outcome from OUTCOMES is a failure, use
Outcome.isFailure()
.
LOOKUP¶
-
pysys.constants.
LOOKUP
= {SKIPPED(non-failure): 'SKIPPED', BLOCKED: 'BLOCKED', DUMPEDCORE: 'DUMPED CORE', TIMEDOUT: 'TIMED OUT', FAILED: 'FAILED', NOTVERIFIED(non-failure): 'NOT VERIFIED', INSPECT(non-failure): 'REQUIRES INSPECTION', PASSED(non-failure): 'PASSED', True: 'TRUE', False: 'FALSE'}¶ Lookup dictionary providing the string representation of test outcomes. :deprecated: Use
str(outcome)
on theOutcome
to convert to the display name.
DEFAULT_TIMEOUT¶
TIMEOUTS¶
-
pysys.constants.
TIMEOUTS
= {'ManualTester': 1800, 'WaitForAvailableTCPPort': 300, 'WaitForFile': 30, 'WaitForProcess': 600, 'WaitForProcessStop': 30, 'WaitForSignal': 60, 'WaitForSocket': 60}¶ Default timeouts used for various operations.
Each timeout is given as a floating point number of seconds.
These timeouts can be customized from a runner plugin (or
pysys.baserunner.BaseRunner.setup()
) if needed (but never change them from within individual testcases).
Outcome¶
-
class
pysys.constants.
Outcome
(id, isFailure, displayName=None)[source]¶ Bases:
object
Represents a PySys test outcome that can be reported using
pysys.basetest.BaseTest.addOutcome()
.The possible outcomes are listed in
OUTCOMES
.Use
str()
or%s
to get the display name for an outcome (e.g. “TIMED OUT”), andisFailure()
to check if it’s a failure outcome.-
isFailure
()[source]¶ - Return bool
True if this outcome is classed as failure, or False if not (e.g.
SKIPPED
andNOTVERIFIED
are not failures).
-
PrintLogs¶
-
class
pysys.constants.
PrintLogs
[source]¶ Bases:
enum.Enum
Enumeration constants that specify when run.log contents are printed to the stdout console.
In all cases a summary of failures is printed at the end, and the user can always look at the run.log inside each output directory if they need more detail.
-
ALL
= 'PrintLogs.ALL'¶ Detailed run.log output is always printed to the stdout console, for both passed and failed testcases.
-
FAILURES
= 'PrintLogs.FAILURES'¶ Detailed run.log output is only printed to the stdout console for failed testcases.
-
NONE
= 'PrintLogs.NONE'¶ Detailed run.log output is not printed to the stdout console.
-