pagepiper/tests
pyr0ball 10cde880b6 fix: clean up CF_ORCH_URL/GPU_SERVER_URL env leak in test_config.py
Found during freeze-branch integration testing (PR #12 + #14 + #15
combined): app/config.py's write-back (os.environ["CF_ORCH_URL"] =
GPU_SERVER_URL) is a module-level side effect monkeypatch never tracks,
so it wasn't being reverted between tests. Once any test_config.py test
set a truthy GPU_SERVER_URL/CF_LICENSE_KEY, the resulting CF_ORCH_URL
wrote leaked into every later test in the same pytest session.

This silently broke all five "skips_embeddings_without_ollama_url"
tests across the shelve_*.py suite (pdf, docx, odt, ods, xlsx) — their
get_llm_config() check no longer saw a clean "nothing configured" state,
so they attempted embedding instead of skipping it. Neither PR #12 nor
#14 alone exercised this combination in the same test session, so it
only surfaced once merged together.

Fix: explicitly pop CF_ORCH_URL/GPU_SERVER_URL/CF_LICENSE_KEY from
os.environ in the autouse teardown fixture before reloading app.config,
rather than relying on monkeypatch to catch a write it never made itself.
2026-07-10 19:24:59 -07:00
..
__init__.py feat: add database schema and migration runner 2026-05-04 17:10:38 -07:00
conftest.py feat: per-user database isolation for cloud instances (closes #4) 2026-05-13 16:31:51 -07:00
test_bm25_index.py fix(services): add SQLite error handling and strengthen top_k test 2026-05-04 17:20:26 -07:00
test_chat_api.py feat(api): add retriever, synthesizer, and chat endpoint (BSL — BYOK gate) 2026-05-04 17:47:10 -07:00
test_config.py fix: clean up CF_ORCH_URL/GPU_SERVER_URL env leak in test_config.py 2026-07-10 19:24:59 -07:00
test_db_migrate.py fix(config): handle /v1 suffix in PAGEPIPER_OLLAMA_URL; add DATA_DIR mkdir guard 2026-05-04 17:13:50 -07:00
test_ingest.py fix(ingest): batch embedding, connection guard, correct upsert id param, module-level imports in tests 2026-05-04 17:36:18 -07:00
test_library_api.py feat: GET /api/library/sample-chunks for Avocet embed bench (closes #6) 2026-05-13 23:01:16 -07:00
test_search_api.py feat: per-user database isolation for cloud instances (closes #4) 2026-05-13 16:31:51 -07:00
test_startup.py feat: per-user database isolation for cloud instances (closes #4) 2026-05-13 16:31:51 -07:00
test_synthesizer.py fix: T7 quality — SynthesisResult.citations tuple, retriever comments, test assertion 2026-05-04 17:51:22 -07:00
test_text_clean.py feat: RAG retrieval quality, artifact cleaning, and ingestion progress UI 2026-05-06 08:25:58 -07:00