3.4 KiB
3.4 KiB
Specification: Test Suite Stabilization & Consolidation (test_stabilization_20260302)
Overview
The goal of this track is to stabilize and unify the project's test suite. This involves resolving pervasive asyncio lifecycle errors, consolidating redundant testing paradigms (specifically manual GUI subprocesses), ensuring artifact isolation in ./tests/artifacts/, implementing functional assertions for currently mocked-out tests, and updating documentation to reflect the finalized verification framework.
Architectural Constraints: Combating Mock-Rot
To prevent future testing entropy caused by "Green-Light Bias" and stateless Tier 3 delegation, this track establishes strict constraints:
- Ban on Aggressive Mocking: Tests MUST NOT use
unittest.mock.patchto arbitrarily hollow out core infrastructure (e.g., theApplifecycle or async loops) just to achieve exit code 0. - Mandatory Centralized Fixtures: All tests interacting with the GUI or AI client MUST use the centralized
app_instanceorlive_guifixtures defined inconftest.py. - Structural Testing Contract: The project workflow must enforce that future AI agents write integration tests against the live state rather than hallucinated mocked environments.
Functional Requirements
- Asyncio Lifecycle Stabilization:
- Resolve
RuntimeError: Event loop is closedacross the suite. - Implement
ThreadPoolExecutorfor blocking calls in GUI-bound tests. - Audit and fix fixture cleanup in
conftest.py.
- Resolve
- Paradigm Consolidation (from testing_consolidation_20260302):
- Refactor integration/visual tests to exclusively use the
live_guipytest fixture. - Eliminate all manual
subprocess.Popencalls togui_2.pyin thetests/andsimulation/directories. - Update legacy tests (e.g.,
test_gui_events.py,test_gui_diagnostics.py) that still import the deprecatedgui_legacy.pyto usegui_2.py. - Completely remove
gui_legacy.pyfrom the project to eliminate confusion.
- Refactor integration/visual tests to exclusively use the
- Artifact Isolation & Discipline:
- All test-generated files (temporary projects, mocks, sessions) MUST be isolated in
./tests/artifacts/. - Prevent leakage into
conductor/tracks/or project root.
- All test-generated files (temporary projects, mocks, sessions) MUST be isolated in
- Enhanced Test Reporting:
- Implement structured, sectioned logging in
./tests/logs/with timestamps (consolidatingVerificationLoggeroutputs).
- Implement structured, sectioned logging in
- Assertion Implementation:
- Replace
pytest.failplaceholders with full functional implementation.
- Replace
- Simulation Regression Fixes:
- Debug and resolve
test_context_sim_liveentry count issues.
- Debug and resolve
- Documentation Updates:
- Update
Readme.md(Testing section) to explain the new log/artifact locations and the--enable-test-hooksrequirement. - Update
docs/guide_simulations.mdto document the centralizedpytestusage instead of standalone simulator scripts.
- Update
Acceptance Criteria
- Full suite run completes without
RuntimeError: Event loop is closedwarnings. - No
subprocess.Popencalls togui_2.pyexist in the test codebase. - No test files import
gui_legacy.py. gui_legacy.pyhas been deleted from the repository.- All test artifacts are isolated in
./tests/artifacts/. - All tests previously marked with
pytest.failnow have passing functional assertions. - Simulation tests pass with correct entry counts.
Readme.mdanddocs/guide_simulations.mdaccurately reflect the new testing infrastructure.