Skip to content

"Vibe-Trading: Your Personal Trading Agent"

test(memory): skip benchmark suite when corpus files are absent

shadowinlifea8bf593d9468
diff --git a/agent/tests/memory/benchmarks/conftest.py b/agent/tests/memory/benchmarks/conftest.py
index a6bdc7f86..1406c4120 100644
--- a/agent/tests/memory/benchmarks/conftest.py
+++ b/agent/tests/memory/benchmarks/conftest.py
@@ -1,4 +1,8 @@
-"""Shared fixtures for memory benchmark tests."""
+"""Shared fixtures for memory benchmark tests.
+
+Corpus files live outside version control (``tmp/benchmark_corpus/``).
+When they are absent the entire benchmark suite is skipped so CI stays green.
+"""
from __future__ import annotations
@@ -13,6 +17,23 @@ PROJECT_ROOT = Path(__file__).resolve().parents[4]
CORPUS_DIR = PROJECT_ROOT / "tmp" / "benchmark_corpus"
+def _require_corpus() -> None:
+ """Skip the benchmark suite when corpus files are missing."""
+ memories = CORPUS_DIR / "memories_with_lifecycle.json"
+ queries = CORPUS_DIR / "queries.json"
+ if not memories.exists() or not queries.exists():
+ pytest.skip(
+ "Benchmark corpus files not found — run locally with corpus data "
+ "or regenerate via pipeline (see BENCHMARK_GUIDE.md §6).",
+ allow_module_level=True,
+ )
+
+
+# Fail-fast at collection time so the whole module is skipped when corpus
+# files are absent, rather than failing on every individual test.
+_require_corpus()
+
+
@pytest.fixture(scope="session")
def memories_corpus() -> list[dict[str, Any]]:
"""Load the 200-entry memory corpus with lifecycle metadata."""