faust.livecheck.models

LiveCheck - Models.

class faust.livecheck.models.State[source]

Test execution status.

INIT = 'INIT'
PASS = 'PASS'
FAIL = 'FAIL'
ERROR = 'ERROR'
TIMEOUT = 'TIMEOUT'
STALL = 'STALL'
SKIP = 'SKIP'
is_ok() → bool[source]

Return True if this is considered an OK state.

Return type

bool

class faust.livecheck.models.SignalEvent(signal_name, case_name, key, value, *, __strict__=True, __faust=None, **kwargs) → None[source]

Signal sent to test (see faust.livecheck.signals.Signal).

signal_name
case_name
key

Describes a field.

Used for every field in Record so that they can be used in join’s /group_by etc.

Examples

>>> class Withdrawal(Record):
...    account_id: str
...    amount: float = 0.0
>>> Withdrawal.account_id
<FieldDescriptor: Withdrawal.account_id: str>
>>> Withdrawal.amount
<FieldDescriptor: Withdrawal.amount: float = 0.0>
Parameters
  • field (str) – Name of field.

  • type (Type) – Field value type.

  • required (bool) – Set to false if field is optional.

  • default (Any) – Default value when required=False.

Keyword Arguments
  • model (Type) – Model class the field belongs to.

  • parent (FieldDescriptorT) – parent field if any.

value

Describes a field.

Used for every field in Record so that they can be used in join’s /group_by etc.

Examples

>>> class Withdrawal(Record):
...    account_id: str
...    amount: float = 0.0
>>> Withdrawal.account_id
<FieldDescriptor: Withdrawal.account_id: str>
>>> Withdrawal.amount
<FieldDescriptor: Withdrawal.amount: float = 0.0>
Parameters
  • field (str) – Name of field.

  • type (Type) – Field value type.

  • required (bool) – Set to false if field is optional.

  • default (Any) – Default value when required=False.

Keyword Arguments
  • model (Type) – Model class the field belongs to.

  • parent (FieldDescriptorT) – parent field if any.

asdict()
class faust.livecheck.models.TestExecution(id, case_name, timestamp, test_args, test_kwargs, expires, *, __strict__=True, __faust=None, **kwargs) → None[source]

Requested test execution.

id
case_name
timestamp
test_args

Describes a field.

Used for every field in Record so that they can be used in join’s /group_by etc.

Examples

>>> class Withdrawal(Record):
...    account_id: str
...    amount: float = 0.0
>>> Withdrawal.account_id
<FieldDescriptor: Withdrawal.account_id: str>
>>> Withdrawal.amount
<FieldDescriptor: Withdrawal.amount: float = 0.0>
Parameters
  • field (str) – Name of field.

  • type (Type) – Field value type.

  • required (bool) – Set to false if field is optional.

  • default (Any) – Default value when required=False.

Keyword Arguments
  • model (Type) – Model class the field belongs to.

  • parent (FieldDescriptorT) – parent field if any.

test_kwargs

Describes a field.

Used for every field in Record so that they can be used in join’s /group_by etc.

Examples

>>> class Withdrawal(Record):
...    account_id: str
...    amount: float = 0.0
>>> Withdrawal.account_id
<FieldDescriptor: Withdrawal.account_id: str>
>>> Withdrawal.amount
<FieldDescriptor: Withdrawal.amount: float = 0.0>
Parameters
  • field (str) – Name of field.

  • type (Type) – Field value type.

  • required (bool) – Set to false if field is optional.

  • default (Any) – Default value when required=False.

Keyword Arguments
  • model (Type) – Model class the field belongs to.

  • parent (FieldDescriptorT) – parent field if any.

expires
classmethod from_headers(headers: Mapping) → Optional[faust.livecheck.models.TestExecution][source]

Create instance from mapping of HTTP/Kafka headers.

Return type

Optional[TestExecution]

as_headers() → Mapping[source]

Return test metadata as mapping of HTTP/Kafka headers.

Return type

Mapping[~KT, +VT_co]

ident[source]

Return long identifier for this test used in logs.

shortident[source]

Return short identifier for this test used in logs.

human_date[source]

Return human-readable description of test timestamp.

was_issued_today[source]

Return True if test was issued on todays date.

is_expired[source]

Return True if this test already expired.

short_case_name[source]

Return abbreviated case name.

asdict()
class faust.livecheck.models.TestReport(case_name, state, signal_latency, test=None, runtime=None, error=None, traceback=None, *, __strict__=True, __faust=None, **kwargs) → None[source]

Report after test execution.

case_name
state

Describes a field.

Used for every field in Record so that they can be used in join’s /group_by etc.

Examples

>>> class Withdrawal(Record):
...    account_id: str
...    amount: float = 0.0
>>> Withdrawal.account_id
<FieldDescriptor: Withdrawal.account_id: str>
>>> Withdrawal.amount
<FieldDescriptor: Withdrawal.amount: float = 0.0>
Parameters
  • field (str) – Name of field.

  • type (Type) – Field value type.

  • required (bool) – Set to false if field is optional.

  • default (Any) – Default value when required=False.

Keyword Arguments
  • model (Type) – Model class the field belongs to.

  • parent (FieldDescriptorT) – parent field if any.

test

Describes a field.

Used for every field in Record so that they can be used in join’s /group_by etc.

Examples

>>> class Withdrawal(Record):
...    account_id: str
...    amount: float = 0.0
>>> Withdrawal.account_id
<FieldDescriptor: Withdrawal.account_id: str>
>>> Withdrawal.amount
<FieldDescriptor: Withdrawal.amount: float = 0.0>
Parameters
  • field (str) – Name of field.

  • type (Type) – Field value type.

  • required (bool) – Set to false if field is optional.

  • default (Any) – Default value when required=False.

Keyword Arguments
  • model (Type) – Model class the field belongs to.

  • parent (FieldDescriptorT) – parent field if any.

runtime
signal_latency
error
traceback
asdict()