Skip to content

Commit 1ce18cf

Browse files
test(conftest): force ENGRAPHIS_EXTRACTOR=none for the offline gate (#166)
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.
1 parent a4e201e commit 1ce18cf

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

conftest.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212
# explicitly via monkeypatch (see tests/test_update_check.py).
1313
os.environ.setdefault("ENGRAPHIS_UPDATE_CHECK", "0")
1414

15-
# Owner machines may configure ENGRAPHIS_EXTRACTOR=llm (via ~/.engraphis/config.env),
16-
# which would make every ingest-path test block on live LLM extraction calls. The unit
17-
# suite is offline-inert by contract (AGENTS.md §1 "primary offline gate"); tests that
18-
# exercise extraction opt back in explicitly via monkeypatch.setenv. setdefault keeps a
19-
# real shell override working, matching how config.env itself defers to the environment.
20-
os.environ.setdefault("ENGRAPHIS_EXTRACTOR", "none")
15+
# Owner machines may configure ENGRAPHIS_EXTRACTOR=llm_structured (via ~/.engraphis/config.env
16+
# or an exported shell variable), which would make every ingest-path test block on live LLM
17+
# extraction calls — and under tests/conftest.py's DNS stub they hang instead of failing
18+
# fast. The unit suite is offline-inert by contract (AGENTS.md §1 "primary offline gate");
19+
# tests that exercise extraction opt back in explicitly via monkeypatch.setenv, so this is
20+
# forced rather than setdefault: no shell export can leak a live LLM into the gate.
21+
os.environ["ENGRAPHIS_EXTRACTOR"] = "none"
2122

2223
# The legacy scripts/test_*.py files are HTTP smoke tests (need a running server +
2324
# httpx), not unit tests. Keep pytest focused on the tests/ suite.

0 commit comments

Comments
 (0)