Skip to content

Commit 4bdd508

Browse files
jmcentireclaude
andcommitted
Add pact-generated smoke tests (142 tests, 44 files)
Smoke tests generated by `pact adopt --dry-run` covering all 51 source modules. Tests verify every module imports and every public function is callable. Layout mirrors source structure: tests/smoke/apprentice/test_*.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a477c8e commit 4bdd508

45 files changed

Lines changed: 1183 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,15 @@ Each task gets its own phase progression, confidence window, and evaluator. A si
275275
git clone https://github.com/jmcentire/apprentice.git
276276
cd apprentice
277277
make dev # Install with dev + lint dependencies
278-
make test # Run all 2,486 tests
278+
make test # Run all 2,628 tests (2,486 unit/integration + 142 smoke)
279279
make test-quick # Stop on first failure
280280
make lint # Run ruff linter
281281
make lint-fix # Auto-fix lint issues
282282
make clean # Remove build artifacts
283283
```
284284

285+
The `tests/smoke/` directory contains 142 pact-generated smoke tests across 44 files, covering all 51 source modules. These tests verify every module imports correctly and every public function is callable. Generated via `pact adopt --dry-run`.
286+
285287
Requires Python 3.12+. Core dependencies: `pydantic`, `pyyaml`, `httpx`. Optional: `pip install apprentice-ai[ml]` for NER-based PII detection (adds `transformers`, `torch`, `datasets`).
286288

287289
## Built With
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
"""Smoke tests for src/apprentice/cli/cli.py (auto-generated by pact adopt)."""
2+
3+
import pytest
4+
5+
def test_import_apprentice_cli_cli():
6+
"""Module imports without error."""
7+
import importlib
8+
mod = importlib.import_module("apprentice.cli.cli")
9+
assert mod is not None
10+
11+
def test_configure_logging_is_callable():
12+
"""Function configure_logging exists and is callable."""
13+
import importlib
14+
mod = importlib.import_module("apprentice.cli.cli")
15+
fn = getattr(mod, "configure_logging", None)
16+
assert fn is not None, "'configure_logging' not found in apprentice.cli.cli"
17+
assert callable(fn)
18+
19+
def test_parse_args_is_callable():
20+
"""Function parse_args exists and is callable."""
21+
import importlib
22+
mod = importlib.import_module("apprentice.cli.cli")
23+
fn = getattr(mod, "parse_args", None)
24+
assert fn is not None, "'parse_args' not found in apprentice.cli.cli"
25+
assert callable(fn)
26+
27+
def test_load_config_is_callable():
28+
"""Function load_config exists and is callable."""
29+
import importlib
30+
mod = importlib.import_module("apprentice.cli.cli")
31+
fn = getattr(mod, "load_config", None)
32+
assert fn is not None, "'load_config' not found in apprentice.cli.cli"
33+
assert callable(fn)
34+
35+
def test_resolve_input_is_callable():
36+
"""Function resolve_input exists and is callable."""
37+
import importlib
38+
mod = importlib.import_module("apprentice.cli.cli")
39+
fn = getattr(mod, "resolve_input", None)
40+
assert fn is not None, "'resolve_input' not found in apprentice.cli.cli"
41+
assert callable(fn)
42+
43+
def test_format_output_is_callable():
44+
"""Function format_output exists and is callable."""
45+
import importlib
46+
mod = importlib.import_module("apprentice.cli.cli")
47+
fn = getattr(mod, "format_output", None)
48+
assert fn is not None, "'format_output' not found in apprentice.cli.cli"
49+
assert callable(fn)
50+
51+
def test_execute_run_is_callable():
52+
"""Function execute_run exists and is callable."""
53+
import importlib
54+
mod = importlib.import_module("apprentice.cli.cli")
55+
fn = getattr(mod, "execute_run", None)
56+
assert fn is not None, "'execute_run' not found in apprentice.cli.cli"
57+
assert callable(fn)
58+
59+
def test_execute_status_is_callable():
60+
"""Function execute_status exists and is callable."""
61+
import importlib
62+
mod = importlib.import_module("apprentice.cli.cli")
63+
fn = getattr(mod, "execute_status", None)
64+
assert fn is not None, "'execute_status' not found in apprentice.cli.cli"
65+
assert callable(fn)
66+
67+
def test_execute_report_is_callable():
68+
"""Function execute_report exists and is callable."""
69+
import importlib
70+
mod = importlib.import_module("apprentice.cli.cli")
71+
fn = getattr(mod, "execute_report", None)
72+
assert fn is not None, "'execute_report' not found in apprentice.cli.cli"
73+
assert callable(fn)
74+
75+
def test_execute_pii_ingest_is_callable():
76+
"""Function execute_pii_ingest exists and is callable."""
77+
import importlib
78+
mod = importlib.import_module("apprentice.cli.cli")
79+
fn = getattr(mod, "execute_pii_ingest", None)
80+
assert fn is not None, "'execute_pii_ingest' not found in apprentice.cli.cli"
81+
assert callable(fn)
82+
83+
def test_execute_pii_evaluate_is_callable():
84+
"""Function execute_pii_evaluate exists and is callable."""
85+
import importlib
86+
mod = importlib.import_module("apprentice.cli.cli")
87+
fn = getattr(mod, "execute_pii_evaluate", None)
88+
assert fn is not None, "'execute_pii_evaluate' not found in apprentice.cli.cli"
89+
assert callable(fn)
90+
91+
def test_execute_ingest_is_callable():
92+
"""Function execute_ingest exists and is callable."""
93+
import importlib
94+
mod = importlib.import_module("apprentice.cli.cli")
95+
fn = getattr(mod, "execute_ingest", None)
96+
assert fn is not None, "'execute_ingest' not found in apprentice.cli.cli"
97+
assert callable(fn)
98+
99+
def test_main_is_callable():
100+
"""Function main exists and is callable."""
101+
import importlib
102+
mod = importlib.import_module("apprentice.cli.cli")
103+
fn = getattr(mod, "main", None)
104+
assert fn is not None, "'main' not found in apprentice.cli.cli"
105+
assert callable(fn)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""Smoke tests for src/apprentice/cli/cli_models.py (auto-generated by pact adopt)."""
2+
3+
import pytest
4+
5+
def test_import_apprentice_cli_cli_models():
6+
"""Module imports without error."""
7+
import importlib
8+
mod = importlib.import_module("apprentice.cli.cli_models")
9+
assert mod is not None
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""Smoke tests for src/apprentice/cli/init_wizard.py (auto-generated by pact adopt)."""
2+
3+
import pytest
4+
5+
def test_import_apprentice_cli_init_wizard():
6+
"""Module imports without error."""
7+
import importlib
8+
mod = importlib.import_module("apprentice.cli.init_wizard")
9+
assert mod is not None
10+
11+
def test_run_wizard_is_callable():
12+
"""Function run_wizard exists and is callable."""
13+
import importlib
14+
mod = importlib.import_module("apprentice.cli.init_wizard")
15+
fn = getattr(mod, "run_wizard", None)
16+
assert fn is not None, "'run_wizard' not found in apprentice.cli.init_wizard"
17+
assert callable(fn)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""Smoke tests for src/apprentice/cli/serve.py (auto-generated by pact adopt)."""
2+
3+
import pytest
4+
5+
def test_import_apprentice_cli_serve():
6+
"""Module imports without error."""
7+
import importlib
8+
mod = importlib.import_module("apprentice.cli.serve")
9+
assert mod is not None
10+
11+
def test_serve_main_is_callable():
12+
"""Function serve_main exists and is callable."""
13+
import importlib
14+
mod = importlib.import_module("apprentice.cli.serve")
15+
fn = getattr(mod, "serve_main", None)
16+
assert fn is not None, "'serve_main' not found in apprentice.cli.serve"
17+
assert callable(fn)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""Smoke tests for src/apprentice/report_generator/core.py (auto-generated by pact adopt)."""
2+
3+
import pytest
4+
5+
def test_import_apprentice_report_generator_core():
6+
"""Module imports without error."""
7+
import importlib
8+
mod = importlib.import_module("apprentice.report_generator.core")
9+
assert mod is not None
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""Smoke tests for src/apprentice/report_generator/models.py (auto-generated by pact adopt)."""
2+
3+
import pytest
4+
5+
def test_import_apprentice_report_generator_models():
6+
"""Module imports without error."""
7+
import importlib
8+
mod = importlib.import_module("apprentice.report_generator.models")
9+
assert mod is not None
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"""Smoke tests for src/apprentice/report_generator/report_generator.py (auto-generated by pact adopt)."""
2+
3+
import pytest
4+
5+
def test_import_apprentice_report_generator_report_generator():
6+
"""Module imports without error."""
7+
import importlib
8+
mod = importlib.import_module("apprentice.report_generator.report_generator")
9+
assert mod is not None
10+
11+
def test_validate_report_config_is_callable():
12+
"""Function validate_report_config exists and is callable."""
13+
import importlib
14+
mod = importlib.import_module("apprentice.report_generator.report_generator")
15+
fn = getattr(mod, "validate_report_config", None)
16+
assert fn is not None, "'validate_report_config' not found in apprentice.report_generator.report_generator"
17+
assert callable(fn)
18+
19+
def test_generate_report_is_callable():
20+
"""Function generate_report exists and is callable."""
21+
import importlib
22+
mod = importlib.import_module("apprentice.report_generator.report_generator")
23+
fn = getattr(mod, "generate_report", None)
24+
assert fn is not None, "'generate_report' not found in apprentice.report_generator.report_generator"
25+
assert callable(fn)
26+
27+
def test_format_report_is_callable():
28+
"""Function format_report exists and is callable."""
29+
import importlib
30+
mod = importlib.import_module("apprentice.report_generator.report_generator")
31+
fn = getattr(mod, "format_report", None)
32+
assert fn is not None, "'format_report' not found in apprentice.report_generator.report_generator"
33+
assert callable(fn)
34+
35+
def test_deliver_webhook_is_callable():
36+
"""Function deliver_webhook exists and is callable."""
37+
import importlib
38+
mod = importlib.import_module("apprentice.report_generator.report_generator")
39+
fn = getattr(mod, "deliver_webhook", None)
40+
assert fn is not None, "'deliver_webhook' not found in apprentice.report_generator.report_generator"
41+
assert callable(fn)
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
"""Smoke tests for src/apprentice/root/composition.py (auto-generated by pact adopt)."""
2+
3+
import pytest
4+
5+
def test_import_apprentice_root_composition():
6+
"""Module imports without error."""
7+
import importlib
8+
mod = importlib.import_module("apprentice.root.composition")
9+
assert mod is not None
10+
11+
def test_create_remote_adapter_is_callable():
12+
"""Function create_remote_adapter exists and is callable."""
13+
import importlib
14+
mod = importlib.import_module("apprentice.root.composition")
15+
fn = getattr(mod, "create_remote_adapter", None)
16+
assert fn is not None, "'create_remote_adapter' not found in apprentice.root.composition"
17+
assert callable(fn)
18+
19+
def test_initialize_composition_root_is_callable():
20+
"""Function initialize_composition_root exists and is callable."""
21+
import importlib
22+
mod = importlib.import_module("apprentice.root.composition")
23+
fn = getattr(mod, "initialize_composition_root", None)
24+
assert fn is not None, "'initialize_composition_root' not found in apprentice.root.composition"
25+
assert callable(fn)
26+
27+
def test_shutdown_composition_root_is_callable():
28+
"""Function shutdown_composition_root exists and is callable."""
29+
import importlib
30+
mod = importlib.import_module("apprentice.root.composition")
31+
fn = getattr(mod, "shutdown_composition_root", None)
32+
assert fn is not None, "'shutdown_composition_root' not found in apprentice.root.composition"
33+
assert callable(fn)
34+
35+
def test_resolve_finetuning_backend_is_callable():
36+
"""Function resolve_finetuning_backend exists and is callable."""
37+
import importlib
38+
mod = importlib.import_module("apprentice.root.composition")
39+
fn = getattr(mod, "resolve_finetuning_backend", None)
40+
assert fn is not None, "'resolve_finetuning_backend' not found in apprentice.root.composition"
41+
assert callable(fn)
42+
43+
def test_build_backend_registry_is_callable():
44+
"""Function build_backend_registry exists and is callable."""
45+
import importlib
46+
mod = importlib.import_module("apprentice.root.composition")
47+
fn = getattr(mod, "build_backend_registry", None)
48+
assert fn is not None, "'build_backend_registry' not found in apprentice.root.composition"
49+
assert callable(fn)
50+
51+
def test_orchestrate_request_is_callable():
52+
"""Function orchestrate_request exists and is callable."""
53+
import importlib
54+
mod = importlib.import_module("apprentice.root.composition")
55+
fn = getattr(mod, "orchestrate_request", None)
56+
assert fn is not None, "'orchestrate_request' not found in apprentice.root.composition"
57+
assert callable(fn)
58+
59+
def test_get_component_statuses_is_callable():
60+
"""Function get_component_statuses exists and is callable."""
61+
import importlib
62+
mod = importlib.import_module("apprentice.root.composition")
63+
fn = getattr(mod, "get_component_statuses", None)
64+
assert fn is not None, "'get_component_statuses' not found in apprentice.root.composition"
65+
assert callable(fn)
66+
67+
def test_create_request_correlation_is_callable():
68+
"""Function create_request_correlation exists and is callable."""
69+
import importlib
70+
mod = importlib.import_module("apprentice.root.composition")
71+
fn = getattr(mod, "create_request_correlation", None)
72+
assert fn is not None, "'create_request_correlation' not found in apprentice.root.composition"
73+
assert callable(fn)
74+
75+
def test_validate_component_override_is_callable():
76+
"""Function validate_component_override exists and is callable."""
77+
import importlib
78+
mod = importlib.import_module("apprentice.root.composition")
79+
fn = getattr(mod, "validate_component_override", None)
80+
assert fn is not None, "'validate_component_override' not found in apprentice.root.composition"
81+
assert callable(fn)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""Smoke tests for src/apprentice/apprentice_class.py (auto-generated by pact adopt)."""
2+
3+
import pytest
4+
5+
def test_import_apprentice_apprentice_class():
6+
"""Module imports without error."""
7+
import importlib
8+
mod = importlib.import_module("apprentice.apprentice_class")
9+
assert mod is not None

0 commit comments

Comments
 (0)