File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,19 @@ def log(msg):
1818 print (f"\033 [36m[test-runner]\033 [0m { msg } " )
1919
2020
21+ def reset_session_fixture (test_home ):
22+ """Reset the session.json fixture to its committed state before tests.
23+
24+ The CLI may modify session.json during MCP operations (like team switching),
25+ so we restore it to the canonical committed version before each test run.
26+ """
27+ session_file = test_home / ".config" / "tower" / "session.json"
28+ subprocess .run (
29+ ["git" , "checkout" , str (session_file )],
30+ capture_output = True ,
31+ )
32+
33+
2134def check_mock_server_health (url ):
2235 """Check if the mock server is running and responding."""
2336 try :
@@ -129,6 +142,8 @@ def main():
129142 return 1
130143
131144 finally :
145+ reset_session_fixture (test_home )
146+
132147 if mock_process :
133148 log ("Stopping mock server..." )
134149 mock_process .terminate ()
You can’t perform that action at this time.
0 commit comments