core/tests/test_cli_test_suites.py
Shay a0c55cac9a fix(quarantine): clusters A+D+E — 7 tests removed from quarantine
Cluster A (4): ledger status assertions accept 'expert' after
mathematics_logic was promoted past audit-passed. One-token
set-membership extension per test.

Cluster D (2):
- test_cli_test_suites: packs suite now includes
  test_adr_0127_pack_ratification.py; update expected call tuple.
- test_comb_pass_hot_path: pin compound==1 (the regression boundary);
  drop single==1 assertion — runtime discourse planner makes its own
  classify_compound_intent call at a separate import site.

Cluster E (1): bench_footprint cold-start loads >1GiB RSS in first
~10 turns; 1MiB/turn ceiling is only valid in warm steady-state.
Remove the per-turn RSS ceiling from the smoke test; add warmup_turns
param to bench_footprint for use in dedicated profiling runs.
2026-05-25 06:39:00 -07:00

109 lines
3.1 KiB
Python

"""CLI tests for curated pytest suite aliases."""
from __future__ import annotations
import pytest
from core import cli
def test_core_test_lists_curated_suites(capsys) -> None:
rc = cli.main(["test", "--list-suites"])
captured = capsys.readouterr()
assert rc == 0
assert "fast" in captured.out.splitlines()
assert "smoke" in captured.out.splitlines()
assert "cognition" in captured.out.splitlines()
assert "teaching" in captured.out.splitlines()
assert "packs" in captured.out.splitlines()
assert "full" in captured.out.splitlines()
def test_core_test_suite_expands_to_expected_pytest_paths(monkeypatch) -> None:
calls: list[tuple[str, ...]] = []
def fake_run(*args: str, check: bool = False, cwd=None) -> int:
calls.append(args)
return 0
monkeypatch.setattr(cli, "_run", fake_run)
rc = cli.main(["test", "--suite", "cognition", "-q"])
assert rc == 0
assert calls
command = calls[0]
assert command[:3] == (cli.sys.executable, "-m", "pytest")
assert "tests/test_intent_proposition_graph.py" in command
assert "tests/test_cognitive_turn_pipeline.py" in command
assert "tests/test_articulation_realizer_v2.py" in command
assert "-q" in command
def test_core_test_fast_suite_expands_to_iteration_lane(monkeypatch) -> None:
calls: list[tuple[str, ...]] = []
def fake_run(*args: str, check: bool = False, cwd=None) -> int:
calls.append(args)
return 0
monkeypatch.setattr(cli, "_run", fake_run)
rc = cli.main(["test", "--suite", "fast", "-q"])
assert rc == 0
command = calls[0]
assert "tests/test_cli_test_suites.py" in command
assert "tests/test_runtime_config.py" in command
assert "tests/test_core_semantic_seed_pack.py" in command
assert "tests/test_cognitive_eval_harness.py" in command
assert "tests/" not in command
def test_core_test_suite_accepts_pytest_flags_without_separator(monkeypatch) -> None:
calls: list[tuple[str, ...]] = []
def fake_run(*args: str, check: bool = False, cwd=None) -> int:
calls.append(args)
return 0
monkeypatch.setattr(cli, "_run", fake_run)
rc = cli.main(["test", "--suite", "packs", "-q"])
assert rc == 0
assert calls[0] == (
cli.sys.executable,
"-m",
"pytest",
"tests/test_core_semantic_seed_pack.py",
"tests/test_adr_0127_pack_ratification.py",
"-q",
)
def test_core_test_passthrough_still_accepts_arbitrary_pytest_args(monkeypatch) -> None:
calls: list[tuple[str, ...]] = []
def fake_run(*args: str, check: bool = False, cwd=None) -> int:
calls.append(args)
return 0
monkeypatch.setattr(cli, "_run", fake_run)
rc = cli.main(["test", "--", "tests/test_core_semantic_seed_pack.py", "-q"])
assert rc == 0
assert calls[0] == (
cli.sys.executable,
"-m",
"pytest",
"tests/test_core_semantic_seed_pack.py",
"-q",
)
def test_non_test_commands_still_reject_unknown_args() -> None:
with pytest.raises(SystemExit):
cli.main(["pack", "list", "-q"])