Skip to content

test: cover embedding accumulator factory wiring (follow-up to #2881)#3047

Open
Vasilije1990 wants to merge 1 commit into
feat/accumulate-embedding-callsfrom
followup/pr-2881
Open

test: cover embedding accumulator factory wiring (follow-up to #2881)#3047
Vasilije1990 wants to merge 1 commit into
feat/accumulate-embedding-callsfrom
followup/pr-2881

Conversation

@Vasilije1990

Copy link
Copy Markdown
Contributor

Summary

Small follow-up stacked on #2881 (base: feat/accumulate-embedding-calls).

  • Adds two unit tests for the create_embedding_engine wiring introduced in feat: accumulate concurrent embedding API calls #2881, which had no coverage:

    • with accumulate_embedding_calls=True, the factory wraps the inner engine in AccumulatingEmbeddingEngine and correctly converts ACCUMULATE_EMBEDDING_TIMEOUT_MS from milliseconds to seconds (50 ms → 0.05 s);
    • with accumulate_embedding_calls=False, the inner engine is returned unwrapped.

    The tests stub LiteLLMEmbeddingEngine via monkeypatch and clear the factory's lru_cache around each test, so no network or heavy deps are involved.

  • Syncs stale docstring defaults in create_embedding_engine: the parameter docs still said default: False / 100 ms, but the actual defaults became True / 20 ms when accumulation was enabled by default in dbeb95d.

All 14 tests in cognee/tests/unit/infrastructure/test_accumulating_embedding_engine.py pass locally; ruff check/format clean.

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant