Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

refactor(tests): consolidate live-service tests into tests/performance/ (#3538)

LearningCircuit0a49fddd2960
diff --git a/tests/performance/README.md b/tests/performance/README.md
index c0375a8391..d28f5bdc13 100644
--- a/tests/performance/README.md
+++ b/tests/performance/README.md
@@ -13,10 +13,17 @@ tests/performance/
├── _shared/ — general pipeline harnesses, not tied to one subsystem
│ ├── run_full_search.py — thin CLI around quick_summary(); --engine / --model flags
│ └── build_eval_dataset.py — cross-product runner (query × engine × model) over run_full_search.py
-└── relevance_filter/ — subsystem: LLM-as-judge relevance filter
- ├── test_live.py — pytest live arXiv + Ollama test (integration + requires_llm + slow)
- ├── eval_prompt.py — human-judgment harness: vary prompt, same judge, same arXiv
- └── eval_models.py — human-judgment harness: vary judge, same prompt, same arXiv
+├── relevance_filter/ — LLM-as-judge relevance filter (live arXiv + Ollama)
+│ ├── test_live.py — pytest live arXiv + Ollama test (integration + requires_llm + slow)
+│ ├── eval_prompt.py — human-judgment harness: vary prompt, same judge, same arXiv
+│ └── eval_models.py — human-judgment harness: vary judge, same prompt, same arXiv
+├── strategies/ — decomposition / iterative-reasoning strategies (live LLM + meta_search)
+│ └── compare_strategies_visual.py — human-judgment harness: cross-strategy timeline plots
+├── content_fetcher/ — HTML extraction quality across 200+ real URLs (live network)
+├── search_engines/ — new-adapter integration against live APIs (Open Library, Zenodo, etc.)
+├── mcp/ — MCP client concurrency (real subprocess echo server)
+├── database/ — encrypted-DB backwards-compat (installs previous PyPI release)
+└── api_auth/ — authenticated research API validation (requires running server + Puppeteer)
```
**When you add performance tests / harnesses for a new subsystem** (e.g.
diff --git a/tests/performance/api_auth/__init__.py b/tests/performance/api_auth/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/performance/api_auth/conftest.py b/tests/performance/api_auth/conftest.py
new file mode 100644
index 0000000000..e07064d5bb
--- /dev/null
+++ b/tests/performance/api_auth/conftest.py
@@ -0,0 +1,98 @@
+"""
+Pytest configuration and shared fixtures for API tests
+"""
+
+import json
+import subprocess
+import uuid
+import pytest
+import requests
+from pathlib import Path
+import tempfile
+import os
+
+# Base URL for tests
+BASE_URL = os.environ.get("LDR_TEST_BASE_URL", "http://127.0.0.1:5000")
+# Use UUID for unique usernames to avoid collisions in parallel tests
+TEST_USERNAME = f"testuser_{uuid.uuid4().hex[:12]}"
+TEST_PASSWORD = "TestPass123"
+
+
+class AuthHelper:
+ """Helper class to handle Puppeteer authentication"""
+
+ @staticmethod
+ def get_auth_cookies():
+ """Use Puppeteer to authenticate and get cookies"""
+ # Create a temporary file for cookie storage
+ cookie_file = tempfile.NamedTemporaryFile(
+ mode="w", suffix=".json", delete=False
+ )
+ cookie_file.close()
+
+ # Run the Node.js auth helper. The JS file still lives under
+ # tests/api_tests_with_login/ — it's shared with other Puppeteer
+ # suites, so we reference it in place rather than duplicate.
+ auth_script = (
+ Path(__file__).parents[2]
+ / "api_tests_with_login"
+ / "auth_helper.js"
+ )
+ cmd = [
+ "node",
+ str(auth_script),
+ BASE_URL,
+ TEST_USERNAME,
+ TEST_PASSWORD,
+ cookie_file.name,
+ ]
+
+ try:
+ result = subprocess.run(
+ cmd, capture_output=True, text=True, timeout=90
+ )
+ if result.returncode != 0:
+ raise Exception(f"Auth failed: {result.stderr}")
+
+ # Read cookies from file
+ with open(cookie_file.name, "r") as f:
+ cookies = json.load(f)
+
+ # Convert to requests format
+ cookie_dict = {c["name"]: c["value"] for c in cookies}
+
+ # Extract CSRF token
+ csrf_token = None
+ for cookie in cookies:
+ if cookie["name"] == "csrf_token":
+ csrf_token = cookie["value"]
+ break
+
+ return cookie_dict, csrf_token
+
+ finally:
+ # Clean up temp file
+ if Path(cookie_file.name).exists():
+ os.unlink(cookie_file.name)
+
+
[email protected](scope="session")
+def auth_session():
+ """Session-wide fixture for authenticated requests"""
+ cookies, csrf_token = AuthHelper.get_auth_cookies()
+
+ session = requests.Session()
+ session.cookies.update(cookies)
+ session.headers.update(
+ {"X-CSRFToken": csrf_token, "Accept": "application/json"}
+ )
+
+ yield session, csrf_token
+
+ session.close()
+
+
+def base_url():
+ """Fixture to provide base URL"""
+ return BASE_URL
diff --git a/tests/api_tests_with_login/pytest_tests/test_research_validation.py b/tests/performance/api_auth/test_research_validation.py
similarity index 100%
rename from tests/api_tests_with_login/pytest_tests/test_research_validation.py
rename to tests/performance/api_auth/test_research_validation.py
diff --git a/tests/performance/content_fetcher/__init__.py b/tests/performance/content_fetcher/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/research_library/downloaders/test_extraction_benchmark.py b/tests/performance/content_fetcher/test_extraction_benchmark.py
similarity index 100%
rename from tests/research_library/downloaders/test_extraction_benchmark.py
rename to tests/performance/content_fetcher/test_extraction_benchmark.py
diff --git a/tests/performance/database/__init__.py b/tests/performance/database/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/database/scripts/__init__.py b/tests/performance/database/scripts/__init__.py
similarity index 100%
rename from tests/database/scripts/__init__.py
rename to tests/performance/database/scripts/__init__.py
diff --git a/tests/database/scripts/create_compat_db.py b/tests/performance/database/scripts/create_compat_db.py
similarity index 100%
rename from tests/database/scripts/create_compat_db.py
rename to tests/performance/database/scripts/create_compat_db.py
diff --git a/tests/database/test_backwards_compatibility.py b/tests/performance/database/test_backwards_compatibility.py
similarity index 100%
rename from tests/database/test_backwards_compatibility.py
rename to tests/performance/database/test_backwards_compatibility.py
diff --git a/tests/performance/mcp/__init__.py b/tests/performance/mcp/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/mcp/echo_server.py b/tests/performance/mcp/echo_server.py
similarity index 100%
rename from tests/mcp/echo_server.py
rename to tests/performance/mcp/echo_server.py
diff --git a/tests/mcp/test_concurrent_mcp_calls.py b/tests/performance/mcp/test_concurrent_mcp_calls.py
similarity index 100%
rename from tests/mcp/test_concurrent_mcp_calls.py
rename to tests/performance/mcp/test_concurrent_mcp_calls.py
diff --git a/tests/performance/search_engines/__init__.py b/tests/performance/search_engines/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/search_engines/test_new_adapters_integration.py b/tests/performance/search_engines/test_new_adapters_integration.py
similarity index 100%
rename from tests/search_engines/test_new_adapters_integration.py
rename to tests/performance/search_engines/test_new_adapters_integration.py
diff --git a/tests/performance/strategies/__init__.py b/tests/performance/strategies/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/strategies/compare_strategies_visual.py b/tests/performance/strategies/compare_strategies_visual.py
similarity index 100%
rename from tests/strategies/compare_strategies_visual.py
rename to tests/performance/strategies/compare_strategies_visual.py
diff --git a/tests/strategies/test_adaptive_strategy.py b/tests/performance/strategies/test_adaptive_strategy.py
similarity index 100%
rename from tests/strategies/test_adaptive_strategy.py
rename to tests/performance/strategies/test_adaptive_strategy.py
diff --git a/tests/strategies/test_iterative_reasoning.py b/tests/performance/strategies/test_iterative_reasoning.py
similarity index 100%
rename from tests/strategies/test_iterative_reasoning.py
rename to tests/performance/strategies/test_iterative_reasoning.py
diff --git a/tests/strategies/test_search_system_iterative.py b/tests/performance/strategies/test_search_system_iterative.py
similarity index 100%
rename from tests/strategies/test_search_system_iterative.py
rename to tests/performance/strategies/test_search_system_iterative.py