chore(tests): hoist bm25-only fixture trio to conftest/helpers#529
Merged
chore(tests): hoist bm25-only fixture trio to conftest/helpers#529
Conversation
PR #465 added ``test_batch_add_tag_isolation.py`` which redefined the ``_isolate_memtomem_env`` + ``_StubCtx`` + ``integration_components`` fixture trio that already lived almost verbatim in ``test_multi_agent_integration.py``. Two callers was tolerable; a third would push it past the extraction threshold (per feedback_refactor_axis.md / the #465 review N1). - conftest.py grows the ``bm25_only_components`` fixture (renamed from ``integration_components`` so the BM25-only / hermetic-config scope is visible at the call site). - helpers.py grows ``StubCtx`` and ``isolate_memtomem_env`` — the latter is exposed (not underscore-prefixed) because the LangGraph adapter cases construct their own ``MemtomemStore`` outside the fixture and need the helper directly. - Both test files drop their local copies and import from the shared module. No behavior change; 23 tests in the two files still pass and the full suite (2999 tests) is green. Closes #467. Co-Authored-By: Claude <[email protected]>
P2 cron Phase A added the ``scheduler`` config section (Mem2MemConfig.scheduler, BaseSettings-backed). A developer with MEMTOMEM_SCHEDULER__ENABLED set in their shell would silently mutate fixture-built configs. Add it to ``isolate_memtomem_env``'s strip list so the helper covers every env-var-bound section that exists today. Sibling sweep (per #529 review #5): ``_StubCtx`` duplicates also live in test_sessions, test_validate_namespace, test_validate_namespace_ns_tools, test_validate_agent_id, test_chunk_links_writer, test_server_degraded_mode — left for a separate cleanup PR to keep #467's scope to the two files named in the issue. Co-Authored-By: Claude <[email protected]>
Owner
Author
|
Sibling sweep result (review #5): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test_batch_add_tag_isolation.pywhich redefined the_isolate_memtomem_env+_StubCtx+integration_componentsfixture trio that already lived intest_multi_agent_integration.py:56-127. Two copies was tolerable; a third would push it past the extraction threshold (fix(mem_batch_add): drop post-index tag broadcast; per-entry tags isolated #465 review N1).conftest.pygrowsbm25_only_components(renamed fromintegration_componentsto make the BM25-only / hermetic-config scope visible at the call site).helpers.pygrowsStubCtxandisolate_memtomem_env— the helper is exposed (not underscore-prefixed) because the LangGraph adapter cases construct their ownMemtomemStoreoutside the fixture and need the helper directly.Closes #467.
Test plan
uv run pytest packages/memtomem/tests/test_multi_agent_integration.py packages/memtomem/tests/test_batch_add_tag_isolation.py(23 passed)uv run pytest packages/memtomem/tests/ -m "not ollama"(2999 passed, 46 deselected)uv run ruff check+ruff format --check🤖 Generated with Claude Code