test: cover embedding accumulator factory wiring (follow-up to #2881)#3047
Open
Vasilije1990 wants to merge 1 commit into
Open
test: cover embedding accumulator factory wiring (follow-up to #2881)#3047Vasilije1990 wants to merge 1 commit into
Vasilije1990 wants to merge 1 commit into
Conversation
Follow-up to #2881. - Add two unit tests for create_embedding_engine wiring: with accumulate_embedding_calls enabled the engine is wrapped in AccumulatingEmbeddingEngine and ACCUMULATE_EMBEDDING_TIMEOUT_MS is converted from milliseconds to seconds; with it disabled the inner engine is returned unwrapped. This path had no coverage. - Fix stale docstring defaults in create_embedding_engine (said default: False / 100 ms; actual defaults are True / 20 ms since the accumulator was enabled by default). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Small follow-up stacked on #2881 (base:
feat/accumulate-embedding-calls).Adds two unit tests for the
create_embedding_enginewiring introduced in feat: accumulate concurrent embedding API calls #2881, which had no coverage:accumulate_embedding_calls=True, the factory wraps the inner engine inAccumulatingEmbeddingEngineand correctly convertsACCUMULATE_EMBEDDING_TIMEOUT_MSfrom milliseconds to seconds (50 ms → 0.05 s);accumulate_embedding_calls=False, the inner engine is returned unwrapped.The tests stub
LiteLLMEmbeddingEnginevia monkeypatch and clear the factory'slru_cachearound each test, so no network or heavy deps are involved.Syncs stale docstring defaults in
create_embedding_engine: the parameter docs still saiddefault: False/100ms, but the actual defaults becameTrue/20ms when accumulation was enabled by default in dbeb95d.All 14 tests in
cognee/tests/unit/infrastructure/test_accumulating_embedding_engine.pypass locally; ruff check/format clean.🤖 Generated with Claude Code