oct
Loading...
Searching...
No Matches
__init__.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3# oct/testing/__init__.py
4
5"""
6Purpose
7-------
8The ``oct test`` v1.0 SEED (Plan 189, spec-10 slice 2): the §9
9workspace/package discovery + selection layer as a pure library. The
10frozen v0.x ``oct test`` CLI is untouched (ADR-T-14); the v1.0 CLI
11cutover will consume this package. The oc_chat stand-in
12(``oc_chat/oc_chat/testing/``) stays independent until the §20.4
13retirement - the two trees share naming, never imports.
14
15Responsibilities
16----------------
17- Re-export the public surface: the §12.4 error taxonomy as data
18 (``errors``), the §9 manifest test view (``manifest``), and the §9
19 precedence + ADR-T-12 walk (``discovery``).
20- No CLI, no entry point, no ``sys.exit`` anywhere in the package -
21 exits are data the future CLI slice maps at its boundary.
22
23Diagnostics
24-----------
25Domain: OCT-TESTING
26Levels:
27 L2: lifecycle events
28 L3: semantic details
29 L4: deep tracing
30
31Contracts
32---------
33- ``oct.core.workspace`` is a read-only dependency; this package
34 layers on top of the v0.25 loader without modifying it.
35- Import surface is stable for the v1.0 CLI slice: everything in
36 ``__all__`` here is the consumable API.
37
38Dependencies
39------------
40- oct.testing.errors (re-exported: the §12.4 error taxonomy as data)
41- oct.testing.manifest (re-exported: the §9 manifest test view)
42- oct.testing.discovery (re-exported: the §9 precedence and ADR-T-12 walk)
43- oct.core.diagnostics (_dbg structured logger; imported but never called here)
44"""
45
46from __future__ import annotations
47
48from oct.testing.discovery import (
49 CWD_RESOLUTION_MESSAGE,
50 MODE_SINGLE_PACKAGE,
51 MODE_WORKSPACE,
52 WALK_LEVELS,
53 DiscoveryResult,
54 SinglePackage,
55 discover,
56 walk_for_package,
57)
58from oct.testing.errors import (
59 CWD_RESOLUTION_FAILED,
60 EXIT_CONFIGURATION_ERROR,
61 EXIT_ORCHESTRATOR_ERROR,
62 IMPLEMENTATION_CODE_CATALOG,
63 KIND_CONFIGURATION,
64 KIND_ORCHESTRATOR,
65 KIND_SIGNAL,
66 MANIFEST_TEST_BLOCK_INVALID,
67 OctTestError,
68 PACKAGE_UNKNOWN,
69 SEVERITY_FATAL,
70 SEVERITY_WARNING,
71 WORKSPACE_AND_PACKAGE_BOTH_PASSED,
72 WORKSPACE_FILE_NOT_FOUND,
73 WORKSPACE_MANIFEST_INVALID,
74 exit_code_for_kind,
75)
76from oct.testing.manifest import (
77 DEFAULT_TEST_PROFILE,
78 TEST_PROFILES,
79 PackageTestConfig,
80 TestManifest,
81 load_test_manifest,
82)
83# OCT-LINT: disable-file=dbg_usage reason="Plan 263: a re-export package root with no function or method, so any _dbg call here would run before oc_diagnostics.init() and add a RuntimeWarning to every oct invocation"
84from oct.core.diagnostics import _dbg
85
86__all__ = [
87 "CWD_RESOLUTION_FAILED",
88 "CWD_RESOLUTION_MESSAGE",
89 "DEFAULT_TEST_PROFILE",
90 "DiscoveryResult",
91 "EXIT_CONFIGURATION_ERROR",
92 "EXIT_ORCHESTRATOR_ERROR",
93 "IMPLEMENTATION_CODE_CATALOG",
94 "KIND_CONFIGURATION",
95 "KIND_ORCHESTRATOR",
96 "KIND_SIGNAL",
97 "MANIFEST_TEST_BLOCK_INVALID",
98 "MODE_SINGLE_PACKAGE",
99 "MODE_WORKSPACE",
100 "OctTestError",
101 "PACKAGE_UNKNOWN",
102 "PackageTestConfig",
103 "SEVERITY_FATAL",
104 "SEVERITY_WARNING",
105 "SinglePackage",
106 "TEST_PROFILES",
107 "TestManifest",
108 "WALK_LEVELS",
109 "WORKSPACE_AND_PACKAGE_BOTH_PASSED",
110 "WORKSPACE_FILE_NOT_FOUND",
111 "WORKSPACE_MANIFEST_INVALID",
112 "discover",
113 "exit_code_for_kind",
114 "load_test_manifest",
115 "walk_for_package",
116]