From b83c07443d5ea5957b894ca472bcf8fb9daaa59f Mon Sep 17 00:00:00 2001 From: Ed_ Date: Mon, 22 Jun 2026 00:42:44 -0400 Subject: [PATCH] chore(audit): create empty tests/test_code_path_audit_live_gui.py v2 Module docstring + skipif gate on CODE_PATH_AUDIT_LIVE_GUI=1. The 2 live_gui tests go in Phase 11. --- tests/test_code_path_audit_live_gui.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/test_code_path_audit_live_gui.py diff --git a/tests/test_code_path_audit_live_gui.py b/tests/test_code_path_audit_live_gui.py new file mode 100644 index 00000000..1898756e --- /dev/null +++ b/tests/test_code_path_audit_live_gui.py @@ -0,0 +1,24 @@ +"""Live_gui E2E tests for src.code_path_audit v2 (opt-in). + +These tests are gated on the CODE_PATH_AUDIT_LIVE_GUI env var. +Set CODE_PATH_AUDIT_LIVE_GUI=1 to enable. The tests use the +session-scoped live_gui fixture from tests/conftest.py to spin +up the full app with --enable-test-hooks on port 8999, then +invoke the code_path_audit_v2 MCP tool via ApiHookClient. + +Per the live_gui test authoring contract (see +docs/guide_testing.md#authoring-robust-live_gui-tests-dont-assume-clean-state), +the tests use poll-until-state-visible rather than time.sleep, +because the v2 audit's MCP tool may run async via +_pending_gui_tasks dispatch. +""" +from __future__ import annotations +import os + +import pytest + +LIVE_GUI_ENABLED = os.environ.get("CODE_PATH_AUDIT_LIVE_GUI") == "1" +pytestmark = pytest.mark.skipif( + not LIVE_GUI_ENABLED, + reason="live_gui E2E test; set CODE_PATH_AUDIT_LIVE_GUI=1 to enable", +) \ No newline at end of file