From 88aefc2f0837ae618497da8a54939a4e076be7d3 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Wed, 4 Mar 2026 17:12:36 -0500 Subject: [PATCH] fix(tests): Sandbox isolation - use SLOP_CONFIG env var for config.toml --- tests/conftest.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 1ff12b7..9d18f27 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -184,16 +184,18 @@ def live_gui() -> Generator[tuple[subprocess.Popen, str], None, None]: shutil.rmtree(temp_workspace) temp_workspace.mkdir(parents=True, exist_ok=True) - # Create dummy config and project files to avoid cluttering root - (temp_workspace / "config.toml").write_text("[projects]\npaths = []\nactive = ''\n", encoding="utf-8") + # Create minimal project files to avoid cluttering root + # NOTE: Do NOT create config.toml here - we use SLOP_CONFIG env var + # to point to the actual project root config.toml (temp_workspace / "manual_slop.toml").write_text("[project]\nname = 'TestProject'\n", encoding="utf-8") (temp_workspace / "conductor" / "tracks").mkdir(parents=True, exist_ok=True) # Resolve absolute paths for shared resources - project_root = Path(os.getcwd()) + project_root = Path(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) + config_file = project_root / "config.toml" cred_file = project_root / "credentials.toml" mcp_file = project_root / "mcp_env.toml" - + # Preserve GUI layout for tests layout_file = Path("manualslop_layout.ini") if layout_file.exists(): @@ -215,6 +217,8 @@ def live_gui() -> Generator[tuple[subprocess.Popen, str], None, None]: # or just run from that CWD. env = os.environ.copy() env["PYTHONPATH"] = str(project_root.absolute()) + if config_file.exists(): + env["SLOP_CONFIG"] = str(config_file.absolute()) if cred_file.exists(): env["SLOP_CREDENTIALS"] = str(cred_file.absolute()) if mcp_file.exists():