Skip to content

"Vibe-Trading: Your Personal Trading Agent"

fix(tests): align CI path expectations

Haozhe Wu012a499f7435
diff --git a/agent/tests/test_loop_helpers.py b/agent/tests/test_loop_helpers.py
index bbaa30e77..ac2d73501 100644
--- a/agent/tests/test_loop_helpers.py
+++ b/agent/tests/test_loop_helpers.py
@@ -3,6 +3,7 @@
from __future__ import annotations
import json
+from pathlib import Path
import pytest
@@ -265,12 +266,12 @@ class TestNormalizeToolRunDir:
def test_resolves_relative_dot_to_memory_run_dir(self) -> None:
args = {"run_dir": "."}
out = _normalize_tool_run_dir(args, "/tmp/run_123")
- assert out["run_dir"] == "/tmp/run_123"
+ assert out["run_dir"] == str(Path("/tmp/run_123").resolve())
def test_resolves_relative_child_to_memory_run_dir(self) -> None:
args = {"run_dir": "risk_parity_run"}
out = _normalize_tool_run_dir(args, "/tmp/run_123")
- assert out["run_dir"] == "/tmp/run_123/risk_parity_run"
+ assert out["run_dir"] == str((Path("/tmp/run_123") / "risk_parity_run").resolve())
def test_preserves_absolute_run_dir(self) -> None:
args = {"run_dir": "/var/tmp/custom_run"}
diff --git a/agent/tests/test_shadow_account.py b/agent/tests/test_shadow_account.py
index 1816a669c..f8257c9fc 100644
--- a/agent/tests/test_shadow_account.py
+++ b/agent/tests/test_shadow_account.py
@@ -500,6 +500,7 @@ def test_extract_shadow_strategy_tool(
monkeypatch.setenv("HOME", str(tmp_path))
monkeypatch.setenv("USERPROFILE", str(tmp_path))
+ monkeypatch.setenv("VIBE_TRADING_ALLOWED_FILE_ROOTS", str(tmp_path))
tool = ExtractShadowStrategyTool()
out = json.loads(tool.execute(journal_path=str(profitable_journal)))
assert out["status"] == "ok"
@@ -514,9 +515,10 @@ def test_extract_shadow_strategy_tool(
@pytest.mark.unit
-def test_extract_shadow_strategy_tool_reports_errors(tmp_path: Path) -> None:
+def test_extract_shadow_strategy_tool_reports_errors(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
from src.tools.shadow_account_tool import ExtractShadowStrategyTool
+ monkeypatch.setenv("VIBE_TRADING_ALLOWED_FILE_ROOTS", str(tmp_path))
tool = ExtractShadowStrategyTool()
out = json.loads(tool.execute(journal_path=str(tmp_path / "missing.csv")))
assert out["status"] == "error"