pcvs.testing.teststate module

class pcvs.testing.teststate.TestState(*values)[source]

Bases: IntEnum

Provide Status management, specifically for tests/jobs.

Defined as an enum, it represents different states a test/Job can take during its lifetime. As tests are then serialized into a JSON file, there is no need for construction/representation (as done for SessionState).

Variables:
  • WAITING (int) – Job is currently waiting to be scheduled

  • IN_PROGRESS (int) – A running Set() handle the job, and is scheduled for run.

  • EXECUTED (int) – Job have been executed, but result status has not been computed yet.

  • SUCCESS (int) – Job successfully run and passes all checks (rc, matchers…)

  • FAILURE (int) – Job didn’t succeed, at least one condition failed.

  • SOFT_TIMEOUT – Job has exceeded his soft time limit but pass.

  • HARD_TIMEOUT – Job has exceeded his hard time limit and got killed.

  • ERR_DEP (int) – Special cases to manage jobs unscheduled because at least one of its dependencies have failed to complete.

  • ERR_OTHER (int) – Any other uncaught situation.

ERR_DEP = 7
ERR_OTHER = 8
EXECUTED = 2
FAILURE = 4
HARD_TIMEOUT = 6
IN_PROGRESS = 1
SOFT_TIMEOUT = 5
SUCCESS = 3
WAITING = 0
classmethod all_states()[source]

All tests states.

Return type:

list[Self]

classmethod bad_states()[source]

State that represent a FAILED test.

Return type:

list[Self]

classmethod from_str(state)[source]

Convert str to TestState.

Return type:

Optional[Self]