checkpoint post gui2_parity
This commit is contained in:
@@ -4,6 +4,13 @@ import time
|
||||
import requests
|
||||
import os
|
||||
import signal
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Ensure project root is in path
|
||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
|
||||
from api_hook_client import ApiHookClient
|
||||
|
||||
def kill_process_tree(pid):
|
||||
"""Robustly kills a process and all its children."""
|
||||
@@ -67,10 +74,17 @@ def live_gui(request):
|
||||
kill_process_tree(process.pid)
|
||||
pytest.fail(f"Failed to start {gui_script} with test hooks.")
|
||||
|
||||
client = ApiHookClient() # Initialize client here
|
||||
try:
|
||||
yield process, gui_script
|
||||
finally:
|
||||
print(f"\n[Fixture] Finally block triggered: Shutting down {gui_script}...")
|
||||
# Reset the GUI state before shutting down
|
||||
try:
|
||||
client.reset_session()
|
||||
time.sleep(1) # Give GUI time to process reset
|
||||
except Exception as e:
|
||||
print(f"[Fixture] Error resetting GUI session: {e}")
|
||||
kill_process_tree(process.pid)
|
||||
log_file.close()
|
||||
|
||||
|
||||
@@ -38,58 +38,5 @@ auto_add = true
|
||||
|
||||
[discussion.discussions.main]
|
||||
git_commit = ""
|
||||
last_updated = "2026-02-24T19:59:10"
|
||||
history = [
|
||||
"@1771981100.9238136\nUser:\nStress test entry 0 Stress test entry 0 Stress test entry 0 Stress test entry 0 Stress test entry 0",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 1 Stress test entry 1 Stress test entry 1 Stress test entry 1 Stress test entry 1",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 2 Stress test entry 2 Stress test entry 2 Stress test entry 2 Stress test entry 2",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 3 Stress test entry 3 Stress test entry 3 Stress test entry 3 Stress test entry 3",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 4 Stress test entry 4 Stress test entry 4 Stress test entry 4 Stress test entry 4",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 5 Stress test entry 5 Stress test entry 5 Stress test entry 5 Stress test entry 5",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 6 Stress test entry 6 Stress test entry 6 Stress test entry 6 Stress test entry 6",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 7 Stress test entry 7 Stress test entry 7 Stress test entry 7 Stress test entry 7",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 8 Stress test entry 8 Stress test entry 8 Stress test entry 8 Stress test entry 8",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 9 Stress test entry 9 Stress test entry 9 Stress test entry 9 Stress test entry 9",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 10 Stress test entry 10 Stress test entry 10 Stress test entry 10 Stress test entry 10",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 11 Stress test entry 11 Stress test entry 11 Stress test entry 11 Stress test entry 11",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 12 Stress test entry 12 Stress test entry 12 Stress test entry 12 Stress test entry 12",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 13 Stress test entry 13 Stress test entry 13 Stress test entry 13 Stress test entry 13",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 14 Stress test entry 14 Stress test entry 14 Stress test entry 14 Stress test entry 14",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 15 Stress test entry 15 Stress test entry 15 Stress test entry 15 Stress test entry 15",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 16 Stress test entry 16 Stress test entry 16 Stress test entry 16 Stress test entry 16",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 17 Stress test entry 17 Stress test entry 17 Stress test entry 17 Stress test entry 17",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 18 Stress test entry 18 Stress test entry 18 Stress test entry 18 Stress test entry 18",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 19 Stress test entry 19 Stress test entry 19 Stress test entry 19 Stress test entry 19",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 20 Stress test entry 20 Stress test entry 20 Stress test entry 20 Stress test entry 20",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 21 Stress test entry 21 Stress test entry 21 Stress test entry 21 Stress test entry 21",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 22 Stress test entry 22 Stress test entry 22 Stress test entry 22 Stress test entry 22",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 23 Stress test entry 23 Stress test entry 23 Stress test entry 23 Stress test entry 23",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 24 Stress test entry 24 Stress test entry 24 Stress test entry 24 Stress test entry 24",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 25 Stress test entry 25 Stress test entry 25 Stress test entry 25 Stress test entry 25",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 26 Stress test entry 26 Stress test entry 26 Stress test entry 26 Stress test entry 26",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 27 Stress test entry 27 Stress test entry 27 Stress test entry 27 Stress test entry 27",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 28 Stress test entry 28 Stress test entry 28 Stress test entry 28 Stress test entry 28",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 29 Stress test entry 29 Stress test entry 29 Stress test entry 29 Stress test entry 29",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 30 Stress test entry 30 Stress test entry 30 Stress test entry 30 Stress test entry 30",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 31 Stress test entry 31 Stress test entry 31 Stress test entry 31 Stress test entry 31",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 32 Stress test entry 32 Stress test entry 32 Stress test entry 32 Stress test entry 32",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 33 Stress test entry 33 Stress test entry 33 Stress test entry 33 Stress test entry 33",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 34 Stress test entry 34 Stress test entry 34 Stress test entry 34 Stress test entry 34",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 35 Stress test entry 35 Stress test entry 35 Stress test entry 35 Stress test entry 35",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 36 Stress test entry 36 Stress test entry 36 Stress test entry 36 Stress test entry 36",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 37 Stress test entry 37 Stress test entry 37 Stress test entry 37 Stress test entry 37",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 38 Stress test entry 38 Stress test entry 38 Stress test entry 38 Stress test entry 38",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 39 Stress test entry 39 Stress test entry 39 Stress test entry 39 Stress test entry 39",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 40 Stress test entry 40 Stress test entry 40 Stress test entry 40 Stress test entry 40",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 41 Stress test entry 41 Stress test entry 41 Stress test entry 41 Stress test entry 41",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 42 Stress test entry 42 Stress test entry 42 Stress test entry 42 Stress test entry 42",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 43 Stress test entry 43 Stress test entry 43 Stress test entry 43 Stress test entry 43",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 44 Stress test entry 44 Stress test entry 44 Stress test entry 44 Stress test entry 44",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 45 Stress test entry 45 Stress test entry 45 Stress test entry 45 Stress test entry 45",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 46 Stress test entry 46 Stress test entry 46 Stress test entry 46 Stress test entry 46",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 47 Stress test entry 47 Stress test entry 47 Stress test entry 47 Stress test entry 47",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 48 Stress test entry 48 Stress test entry 48 Stress test entry 48 Stress test entry 48",
|
||||
"@1771981100.9238136\nUser:\nStress test entry 49 Stress test entry 49 Stress test entry 49 Stress test entry 49 Stress test entry 49",
|
||||
"@2026-02-24T19:58:27\nUser:\nHello! This is an automated test. Just say 'Acknowledged'.",
|
||||
"@2026-02-24T19:58:29\nAI:\nAcknowledged",
|
||||
]
|
||||
last_updated = "2026-02-24T21:55:18"
|
||||
history = []
|
||||
|
||||
@@ -9,18 +9,18 @@ from unittest.mock import patch
|
||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
|
||||
from api_hook_client import ApiHookClient
|
||||
import gui
|
||||
import gui_legacy
|
||||
|
||||
def test_hooks_enabled_via_cli():
|
||||
with patch.object(sys, 'argv', ['gui.py', '--enable-test-hooks']):
|
||||
app = gui.App()
|
||||
with patch.object(sys, 'argv', ['gui_legacy.py', '--enable-test-hooks']):
|
||||
app = gui_legacy.App()
|
||||
assert app.test_hooks_enabled is True
|
||||
|
||||
def test_hooks_disabled_by_default():
|
||||
with patch.object(sys, 'argv', ['gui.py']):
|
||||
with patch.object(sys, 'argv', ['gui_legacy.py']):
|
||||
if 'SLOP_TEST_HOOKS' in os.environ:
|
||||
del os.environ['SLOP_TEST_HOOKS']
|
||||
app = gui.App()
|
||||
app = gui_legacy.App()
|
||||
assert getattr(app, 'test_hooks_enabled', False) is False
|
||||
|
||||
def test_live_hook_server_responses(live_gui):
|
||||
|
||||
Reference in New Issue
Block a user