oct
Loading...
Searching...
No Matches
oct.testing.errors Namespace Reference

Classes

class  OctTestError

Functions

int exit_code_for_kind (str kind)

Variables

str KIND_CONFIGURATION = "configuration"
str KIND_ORCHESTRATOR = "orchestrator"
str KIND_SIGNAL = "signal"
str SEVERITY_FATAL = "fatal"
str SEVERITY_WARNING = "warning"
str WORKSPACE_FILE_NOT_FOUND = "WORKSPACE_FILE_NOT_FOUND"
str WORKSPACE_AND_PACKAGE_BOTH_PASSED = "WORKSPACE_AND_PACKAGE_BOTH_PASSED"
str PACKAGE_UNKNOWN = "PACKAGE_UNKNOWN"
str CWD_RESOLUTION_FAILED = "CWD_RESOLUTION_FAILED"
str WORKSPACE_MANIFEST_INVALID = "9101"
str MANIFEST_TEST_BLOCK_INVALID = "9102"
dict IMPLEMENTATION_CODE_CATALOG
int EXIT_ORCHESTRATOR_ERROR = 3
int EXIT_CONFIGURATION_ERROR = 4
dict _KIND_TO_EXIT

Detailed Description

Purpose
-------
The spec-10 §12.4 error taxonomy for the ``oct test`` v1.0 seed
(Plan 189) - AS DATA. The library never calls ``sys.exit``; it raises
:class:`OctTestError` carrying the stable §12.4 code, the error kind,
and the severity, plus the kind → exit-code mapping the future v1.0
CLI slice applies at its boundary.

Responsibilities
----------------
- Define the §12.4 stable identifiers the discovery layer emits
  (``WORKSPACE_FILE_NOT_FOUND``, ``WORKSPACE_AND_PACKAGE_BOTH_PASSED``,
  ``PACKAGE_UNKNOWN``, ``CWD_RESOLUTION_FAILED``).
- Define and CATALOG the implementation-specific ``9xxx`` extension
  codes this seed uses (§12.4 reserves the range and requires the
  implementation to document its codes; ``IMPLEMENTATION_CODE_CATALOG``
  is that catalog).
- Provide :class:`OctTestError` and its §11 ``errors[]``-entry
  projection, and :func:`exit_code_for_kind` (configuration → 4,
  orchestrator → 3, signal → 3 per §12.3/§12.6/§12.7).

Diagnostics
-----------
Domain: OCT-TESTING
Levels:
    L2: lifecycle events (none emitted here - pure data module)
    L3: semantic details (none emitted here)
    L4: deep tracing (none emitted here)

Contracts
---------
- NO ``sys.exit`` and no I/O in this module - exits are data the CLI
  maps later (Plan 189 pinned decision).
- Two conditions never share a code (§12.8 house rule): the base
  v0.25 loader rejecting an existing manifest is ``9101``; a
  test-block/test-config content violation is ``9102``.
- Every §12.4 stable identifier is its own value, so consumers can
  compare against these constants or against the spec's literals.

Dependencies
------------
- oct.core.diagnostics (_dbg structured logger)

Function Documentation

◆ exit_code_for_kind()

int oct.testing.errors.exit_code_for_kind ( str kind)
Return the §12 exit code for an error *kind*.

Parameters
----------
kind
    One of :data:`KIND_CONFIGURATION`, :data:`KIND_ORCHESTRATOR`,
    :data:`KIND_SIGNAL`.

Returns
-------
int
    ``4`` for configuration errors, ``3`` for orchestrator and
    signal errors.

Raises
------
ValueError
    If *kind* is not one of the three taxonomy kinds (a caller
    bug, not a runtime condition - VALIDATION_ERROR class).

Definition at line 149 of file errors.py.

Here is the caller graph for this function:

Variable Documentation

◆ _KIND_TO_EXIT

dict oct.testing.errors._KIND_TO_EXIT
protected
Initial value:
1= {
2 KIND_CONFIGURATION: EXIT_CONFIGURATION_ERROR,
3 KIND_ORCHESTRATOR: EXIT_ORCHESTRATOR_ERROR,
4 KIND_SIGNAL: EXIT_ORCHESTRATOR_ERROR,
5}

Definition at line 142 of file errors.py.

◆ CWD_RESOLUTION_FAILED

str oct.testing.errors.CWD_RESOLUTION_FAILED = "CWD_RESOLUTION_FAILED"

Definition at line 95 of file errors.py.

◆ EXIT_CONFIGURATION_ERROR

int oct.testing.errors.EXIT_CONFIGURATION_ERROR = 4

Definition at line 140 of file errors.py.

◆ EXIT_ORCHESTRATOR_ERROR

int oct.testing.errors.EXIT_ORCHESTRATOR_ERROR = 3

Definition at line 137 of file errors.py.

◆ IMPLEMENTATION_CODE_CATALOG

dict oct.testing.errors.IMPLEMENTATION_CODE_CATALOG
Initial value:
1= {
2 # OCT-LINT: disable=no_hardcoded_secrets reason="Exit-code catalogue prose, not a secret"
3 WORKSPACE_MANIFEST_INVALID: (
4 "workspace manifest exists but the v0.25 base loader rejects "
5 "it (schema/version/name/subprojects/JSON failure)"
6 ),
7 MANIFEST_TEST_BLOCK_INVALID: (
8 "workspace manifest base schema is valid but a §9 test block "
9 "or the top-level default_test_profile is invalid"
10 ),
11}

Definition at line 118 of file errors.py.

◆ KIND_CONFIGURATION

str oct.testing.errors.KIND_CONFIGURATION = "configuration"

Definition at line 60 of file errors.py.

◆ KIND_ORCHESTRATOR

str oct.testing.errors.KIND_ORCHESTRATOR = "orchestrator"

Definition at line 63 of file errors.py.

◆ KIND_SIGNAL

str oct.testing.errors.KIND_SIGNAL = "signal"

Definition at line 66 of file errors.py.

◆ MANIFEST_TEST_BLOCK_INVALID

str oct.testing.errors.MANIFEST_TEST_BLOCK_INVALID = "9102"

Definition at line 113 of file errors.py.

◆ PACKAGE_UNKNOWN

str oct.testing.errors.PACKAGE_UNKNOWN = "PACKAGE_UNKNOWN"

Definition at line 91 of file errors.py.

◆ SEVERITY_FATAL

str oct.testing.errors.SEVERITY_FATAL = "fatal"

Definition at line 69 of file errors.py.

◆ SEVERITY_WARNING

str oct.testing.errors.SEVERITY_WARNING = "warning"

Definition at line 73 of file errors.py.

◆ WORKSPACE_AND_PACKAGE_BOTH_PASSED

str oct.testing.errors.WORKSPACE_AND_PACKAGE_BOTH_PASSED = "WORKSPACE_AND_PACKAGE_BOTH_PASSED"

Definition at line 86 of file errors.py.

◆ WORKSPACE_FILE_NOT_FOUND

str oct.testing.errors.WORKSPACE_FILE_NOT_FOUND = "WORKSPACE_FILE_NOT_FOUND"

Definition at line 82 of file errors.py.

◆ WORKSPACE_MANIFEST_INVALID

str oct.testing.errors.WORKSPACE_MANIFEST_INVALID = "9101"

Definition at line 106 of file errors.py.