5.7 KiB
5.7 KiB
Implementation Plan: Test Suite Stabilization & Consolidation (test_stabilization_20260302)
Phase 1: Infrastructure & Paradigm Consolidation [checkpoint: 8666137]
- Task: Initialize MMA Environment
activate_skill mma-orchestrator[Manual] - Task: Setup Artifact Isolation Directories [
570c0ea]- WHERE: Project root
- WHAT: Create
./tests/artifacts/and./tests/logs/directories. Add.gitignoreto both containing*and!.gitignore. - HOW: Use PowerShell
New-ItemandOut-File. - SAFETY: Do not commit artifacts.
- Task: Migrate Manual Launchers to
live_guiFixture [6b7cd0a]- WHERE:
tests/visual_mma_verification.py(lines 15-40),simulation/scripts. - WHAT: Replace
subprocess.Popen(["python", "gui_2.py"])with thelive_guifixture injected intopytesttest functions. Remove manual while-loop sleeps. - HOW: Use standard pytest
def test_... (live_gui):and rely onApiHookClientwith proper timeouts. - SAFETY: Ensure
subprocessis not orphaned if test fails.
- WHERE:
- Task: Conductor - User Manual Verification 'Phase 1: Infrastructure & Consolidation' (Protocol in workflow.md)
Phase 2: Asyncio Stabilization & Logging [checkpoint: 14613df]
- Task: Audit and Fix
conftest.pyLoop Lifecycle [5a0ec66]- WHERE:
tests/conftest.py:20-50(aroundapp_instancefixture). - WHAT: Ensure the
app._loop.stop()cleanup safely cancels pending background tasks. - HOW: Use
asyncio.all_tasks(loop)andtask.cancel()before stopping the loop in the fixture teardown. - SAFETY: Thread-safety; only cancel tasks belonging to the app's loop.
- WHERE:
- Task: Resolve
Event loop is closedin Core Test Suite [82aa288]- WHERE:
tests/test_spawn_interception.py,tests/test_gui_streaming.py. - WHAT: Update blocking calls to use
ThreadPoolExecutororasyncio.run_coroutine_threadsafe(..., loop). - HOW: Pass the active loop from
app_instanceto the functions triggering the events. - SAFETY: Prevent event queue deadlocks.
- WHERE:
- Task: Implement Centralized Sectioned Logging Utility [
51f7c2a]- WHERE:
tests/conftest.py:50-80(VerificationLogger). - WHAT: Route
VerificationLoggeroutput to./tests/logs/instead oflogs/test/. - HOW: Update
self.logs_dir = Path(f"tests/logs/{datetime.datetime.now().strftime('%Y%m%d_%H%M%S')}"). - SAFETY: No state impact.
- WHERE:
- Task: Conductor - User Manual Verification 'Phase 2: Asyncio & Logging' (Protocol in workflow.md)
Phase 3: Assertion Implementation & Legacy Cleanup [checkpoint: 14ac983]
- Task: Replace
pytest.failwith Functional Assertions (api_events,execution_engine) [194626e]- WHERE:
tests/test_api_events.py:40,tests/test_execution_engine.py:45. - WHAT: Implement actual
assertstatements testing the mock calls and status updates. - HOW: Use
MagicMock.assert_called_withand checkticket.status == "completed". - SAFETY: Isolate mocks.
- WHERE:
- Task: Replace
pytest.failwith Functional Assertions (token_usage,agent_capabilities) [ffc5d75]- WHERE:
tests/test_token_usage.py,tests/test_agent_capabilities.py. - WHAT: Implement tests verifying the
usage_metadataextraction andlist_modelsoutput count. - HOW: Check for 6 models (including
gemini-2.0-flash) inlist_modelstest. - SAFETY: Isolate mocks.
- WHERE:
- Task: Resolve Simulation Entry Count Regressions [
dbd955a]- WHERE:
tests/test_extended_sims.py:20. - WHAT: Fix
AssertionError: Expected at least 2 entries, found 0. - HOW: Update simulation flow to properly wait for the
UserandAIentries to populate the GUI history before asserting. - SAFETY: Use dynamic wait (
ApiHookClient.wait_for_event) instead of static sleeps.
- WHERE:
- Task: Remove Legacy
gui_legacyTest Imports & File [4d171ff]- WHERE:
tests/test_gui_events.py,tests/test_gui_updates.py,tests/test_gui_diagnostics.py, and project root. - WHAT: Change
from gui_legacy import Apptofrom gui_2 import App. Fix any breaking UI locators. Then deletegui_legacy.py. - HOW: String replacement and standard
os.remove. - SAFETY: Verify no remaining imports exist across the suite using
grep_search.
- WHERE:
- Task: Resolve
pytest.failintests/test_agent_tools_wiring.py[20b2e2d]- WHERE:
tests/test_agent_tools_wiring.py. - WHAT: Implement actual assertions for
test_set_agent_tools. - HOW: Verify that
ai_client.set_agent_toolscorrectly updates the active tool set. - SAFETY: Use mocks for
ai_clientif necessary.
- WHERE:
- Task: Conductor - User Manual Verification 'Phase 3: Assertions & Legacy Cleanup' (Protocol in workflow.md)
Phase 4: Documentation & Final Verification
- Task: Model Switch Request [Manual]
- Ask the user to run the
/modelcommand to switch to a high reasoning model for the documentation phase. Wait for their confirmation before proceeding.
- Ask the user to run the
- Task: Update Core Documentation & Workflow Contract [
6b2270f]- WHERE:
Readme.md,docs/guide_simulations.md,conductor/workflow.md. - WHAT: Document artifact locations,
live_guistandard, and the strict "Structural Testing Contract". - HOW: Markdown editing. Add sections explicitly banning arbitrary
unittest.mock.patchon core infra for Tier 3 workers. - SAFETY: Keep formatting clean.
- WHERE:
- Task: Full Suite Validation & Warning Cleanup [
5401fc7] - Task: Final Artifact Isolation Verification [
7c70f74] - [~] Task: Conductor - User Manual Verification 'Phase 4: Documentation & Final Verification' (Protocol in workflow.md)