From 7503e2ebd0ecd03311c1b327caa27455a55ec8f6 Mon Sep 17 00:00:00 2001 From: Coding-Dev-Tools Date: Tue, 25 Aug 2026 07:02:55 -0400 Subject: [PATCH] test(conftest): force ENGRAPHIS_EXTRACTOR=none for the offline gate setdefault kept a real shell export working, so an owner machine exporting ENGRAPHIS_EXTRACTOR=llm_structured leaked a live LLM extractor into every ingest-path test. Under tests/conftest.py's DNS stub the extraction call hangs instead of failing fast, deterministically timing out test_session_close_linearizes_before_delayed_memory_write[ingest]. Force the variable to "none" like ENGRAPHIS_UPDATE_CHECK; tests that exercise extraction already opt back in explicitly via monkeypatch.setenv. --- conftest.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/conftest.py b/conftest.py index 6f4fdbd0..2d42eb0a 100644 --- a/conftest.py +++ b/conftest.py @@ -12,12 +12,13 @@ # explicitly via monkeypatch (see tests/test_update_check.py). os.environ.setdefault("ENGRAPHIS_UPDATE_CHECK", "0") -# Owner machines may configure ENGRAPHIS_EXTRACTOR=llm (via ~/.engraphis/config.env), -# which would make every ingest-path test block on live LLM extraction calls. The unit -# suite is offline-inert by contract (AGENTS.md §1 "primary offline gate"); tests that -# exercise extraction opt back in explicitly via monkeypatch.setenv. setdefault keeps a -# real shell override working, matching how config.env itself defers to the environment. -os.environ.setdefault("ENGRAPHIS_EXTRACTOR", "none") +# Owner machines may configure ENGRAPHIS_EXTRACTOR=llm_structured (via ~/.engraphis/config.env +# or an exported shell variable), which would make every ingest-path test block on live LLM +# extraction calls — and under tests/conftest.py's DNS stub they hang instead of failing +# fast. The unit suite is offline-inert by contract (AGENTS.md §1 "primary offline gate"); +# tests that exercise extraction opt back in explicitly via monkeypatch.setenv, so this is +# forced rather than setdefault: no shell export can leak a live LLM into the gate. +os.environ["ENGRAPHIS_EXTRACTOR"] = "none" # The legacy scripts/test_*.py files are HTTP smoke tests (need a running server + # httpx), not unit tests. Keep pytest focused on the tests/ suite.