-
Notifications
You must be signed in to change notification settings - Fork 1k
chore: retriever test reorganization + adding new tests (integration) (STEP 1) #1881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: retriever test reorganization + adding new tests (integration) (STEP 1) #1881
Conversation
Please make sure all the checkboxes are checked:
|
WalkthroughRemoves numerous unit tests, adds new integration tests for retrieval modules, changes TripletRetriever.default top_k from 1 to 5, and simplifies formatting in brute-force triplet search by removing a helper and a debug print. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~35 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…evers-tests-reorg
…th provided context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
cognee/tests/unit/modules/retrieval/test_brute_force_triplet_search.py (1)
385-398: Test setup does not match implementation behavior.Looking at the
get_memory_fragmentimplementation, the code callsmemory_fragment.project_graph_from_db(graph_engine, ...)on theCogneeGraphinstance, not on thegraph_engineitself. Settingmock_graph_engine.project_graph_from_dbto raise an exception won't trigger the error path being tested.This test should patch
CogneeGraphto return a mock that raises an exception, similar to the test above it.@pytest.mark.asyncio async def test_get_memory_fragment_returns_empty_graph_on_error(): """Test that get_memory_fragment returns empty graph on generic error.""" mock_graph_engine = AsyncMock() - mock_graph_engine.project_graph_from_db = AsyncMock(side_effect=Exception("Generic error")) + + mock_fragment = MagicMock(spec=CogneeGraph) + mock_fragment.project_graph_from_db = AsyncMock(side_effect=Exception("Generic error")) + mock_fragment.nodes = [] - with patch( - "cognee.modules.retrieval.utils.brute_force_triplet_search.get_graph_engine", - return_value=mock_graph_engine, + with ( + patch( + "cognee.modules.retrieval.utils.brute_force_triplet_search.get_graph_engine", + return_value=mock_graph_engine, + ), + patch( + "cognee.modules.retrieval.utils.brute_force_triplet_search.CogneeGraph", + return_value=mock_fragment, + ), ): fragment = await get_memory_fragment() - assert isinstance(fragment, CogneeGraph) - assert len(fragment.nodes) == 0 + assert fragment == mock_fragment + mock_fragment.project_graph_from_db.assert_awaited_once()cognee/tests/integration/retrieval/test_triplet_retriever.py (1)
44-48: Avoid bare except in cleanup handlers.Same issue as in test_temporal_retriever.py: bare
except Exceptionsuppresses all exceptions, including those that might indicate cleanup failures requiring attention.Be more specific or at minimum log the exception:
try: await cognee.prune.prune_data() await cognee.prune.prune_system(metadata=True) - except Exception: - pass + except Exception as e: + print(f"Cleanup warning: {e}")Also applies to: 70-74
♻️ Duplicate comments (2)
cognee/tests/integration/retrieval/test_graph_completion_retriever_context_extension.py (1)
16-60: Consider extracting common fixture setup logic.These three fixtures share the same setup/teardown pattern seen in test_temporal_retriever.py. Consider using a shared helper function as suggested in that file's review.
Also applies to: 62-134, 136-161
cognee/tests/integration/retrieval/test_graph_completion_retriever.py (1)
14-74: Consider extracting common fixture setup logic.These fixtures share the same setup/teardown pattern seen across multiple integration test files. Consider creating a shared helper to reduce duplication.
Also applies to: 76-144, 146-171
🧹 Nitpick comments (21)
cognee/tests/unit/modules/retrieval/test_brute_force_triplet_search.py (2)
663-663: Simplify redundant assertion logic.The assertion
assert "None" not in result or result.count("None") == 0is logically redundant. If"None" not in resultisTrue, the assertion passes. If"None"is in the result, thenresult.count("None")will always be> 0, making the second conditionFalse. This simplifies to just checking if"None"is not in the result.- assert "None" not in result or result.count("None") == 0 + assert "None" not in result
359-359: Consider removing implementation line number references from docstrings.References to specific line numbers in the implementation (e.g., "line 85", "lines 145-147") are brittle and will become stale as the codebase evolves. The test names and descriptions already clearly communicate the behavior being tested.
For example:
- """Test that get_memory_fragment returns empty graph when entity not found (line 85).""" + """Test that get_memory_fragment returns empty graph when entity not found."""Similar changes apply to docstrings at lines 667, 689, 703, 736, 756, and 789.
cognee/tests/unit/modules/retrieval/test_graph_summary_completion_retriever.py (1)
30-47: Consider asserting all passed parameters.The test passes
wide_search_top_k,triplet_distance_penalty, andsystem_promptbut doesn't assert their values. If these are accessible as instance attributes (even if stored by the parent class), consider adding assertions to ensure they're properly set.Example additions:
assert retriever.top_k == 10 assert retriever.save_interaction is True + assert retriever.system_prompt == "Custom system prompt" + assert retriever.wide_search_top_k == 200 + assert retriever.triplet_distance_penalty == 2.5cognee/tests/unit/modules/retrieval/test_user_qa_feedback.py (1)
30-311: Consider adding error handling and edge case tests.While the current tests provide excellent coverage of success paths, consider adding:
- Error handling tests (LLM failures, graph engine exceptions)
- Edge case tests (empty feedback text, special characters, very long input)
These additions would improve test robustness and catch potential failure scenarios.
cognee/tests/unit/modules/retrieval/test_completion.py (2)
6-228: Generate completion tests look solid; consider tighteningread_query_promptassertions and DRYing setupThis suite exercises the key branches of
generate_completion(system prompt vs file, conversation history, response_model, and prompt rendering) and matches the implementation behavior well.Two optional improvements:
- Where you patch
read_query_prompt(e.g., Lines 45-58, 81-94, 163-171, 200-208), also assert its call signature (assert_called_once_with(system_prompt_path)) to lock in the expected prompt-path wiring, similar to what you already do forsummarize_text.- The repeated patch setup for
render_promptandLLMGateway.acreate_structured_outputacross these tests could be factored into pytest fixtures or helper functions to reduce duplication and keep individual tests more focused on behavior.You could also add a short class-level docstring on
TestGenerateCompletionsummarizing the scenarios covered, but that’s purely stylistic.
230-343: Summarize text tests cover main paths; consider adding a custom response_model case and reusing setupThese tests nicely validate
summarize_textbehavior for:
- Provided vs file-based system prompts
- Default vs custom
system_prompt_path- Forwarding of
text_inputto the LLM gatewayTwo optional extensions:
- Add a test variant that passes a non-default
response_model(e.g., aMagicMockor a simple model type) and asserts it’s forwarded toLLMGateway.acreate_structured_output, mirroring what you do forgenerate_completion.- As with the previous class, you can reduce repetition by introducing shared fixtures/helpers for the
read_query_promptand LLM patches, and optionally add a brief class docstring forTestSummarizeText.cognee/modules/retrieval/triplet_retriever.py (1)
34-39: Redundant None check due to default value.The parameter
top_kalready defaults to5in the signature (line 34), so the conditional on line 39 only guards against explicitNonebeing passed. If the intent is to allow callers to explicitly passNoneto reset to default, this is acceptable. Otherwise, consider simplifying:def __init__( self, user_prompt_path: str = "context_for_question.txt", system_prompt_path: str = "answer_simple_question.txt", system_prompt: Optional[str] = None, - top_k: Optional[int] = 5, + top_k: int = 5, ): """Initialize retriever with optional custom prompt paths.""" self.user_prompt_path = user_prompt_path self.system_prompt_path = system_prompt_path - self.top_k = top_k if top_k is not None else 5 + self.top_k = top_k self.system_prompt = system_promptcognee/tests/unit/modules/retrieval/temporal_retriever_test.py (1)
1-9: Unused importos.The
osmodule is imported on line 3 but does not appear to be used anywhere in the test file. Consider removing it.from types import SimpleNamespace import pytest -import os from unittest.mock import AsyncMock, patch, MagicMock from datetime import datetimecognee/tests/integration/retrieval/test_structured_output.py (2)
1-6: Unused importsasyncioandos.Neither
asyncionorosappear to be used in this test file. Consider removing them.-import asyncio -import os import pytest import pathlib import pytest_asyncio import cognee
199-203: Bare exception handler silences cleanup failures.The teardown uses a broad
except Exception: passwhich may hide important errors during cleanup. Consider logging the exception or being more selective about which exceptions to ignore.try: await cognee.prune.prune_data() await cognee.prune.prune_system(metadata=True) - except Exception: - pass + except Exception as e: + import logging + logging.getLogger(__name__).warning(f"Cleanup failed during teardown: {e}")cognee/tests/integration/retrieval/test_summaries_retriever.py (2)
1-5: Unused importos.The
osmodule is imported but not used in this test file.-import os import pytest import pathlib import pytest_asyncio import cognee
131-135: Bare exception handler in teardown.Same issue as other fixtures - consider logging cleanup failures rather than silently ignoring them.
try: await cognee.prune.prune_data() await cognee.prune.prune_system(metadata=True) - except Exception: - pass + except Exception as e: + import logging + logging.getLogger(__name__).warning(f"Cleanup failed: {e}")cognee/tests/unit/modules/retrieval/conversation_history_test.py (1)
22-38: Consider import placement for consistency.The test imports
get_conversation_historyinside thewithblock context. While this ensures the patch is active during import, it's an unconventional pattern. This is acceptable for testing scenarios where the module caches references at import time, but consider adding a brief comment explaining this choice for future maintainers.cognee/tests/integration/retrieval/test_temporal_retriever.py (1)
15-128: Consider extracting common fixture setup logic to reduce duplication.The three fixtures share nearly identical setup and teardown patterns (configuring directories, pruning, setup, yield, cleanup). This duplication increases maintenance burden.
Consider creating a helper function or a parameterized fixture to reduce duplication:
async def setup_test_env(test_name: str): """Helper to set up test environment with custom paths.""" base_dir = pathlib.Path(__file__).parent.parent.parent.parent system_directory_path = str(base_dir / f".cognee_system/{test_name}") data_directory_path = str(base_dir / f".data_storage/{test_name}") cognee.config.system_root_directory(system_directory_path) cognee.config.data_root_directory(data_directory_path) await cognee.prune.prune_data() await cognee.prune.prune_system(metadata=True) await setup() async def teardown_test_env(): """Helper to tear down test environment.""" try: await cognee.prune.prune_data() await cognee.prune.prune_system(metadata=True) except Exception: passThen simplify each fixture to focus on its unique data setup.
cognee/tests/integration/retrieval/test_triplet_retriever.py (1)
112-119: Redundant setup() call in test.Line 114 explicitly calls
await setup()after the fixture has already set up the environment. Thesetup_test_environment_emptyfixture should handle all necessary setup, making this call redundant and potentially confusing.Remove the redundant setup call:
@pytest.mark.asyncio async def test_triplet_retriever_context_empty(setup_test_environment_empty): """Integration test: verify TripletRetriever handles empty graph correctly.""" - await setup() - retriever = TripletRetriever() with pytest.raises(NoDataError): await retriever.get_context("Alice")If the explicit setup is needed, this suggests the fixture might not be working as intended and should be investigated.
cognee/tests/integration/retrieval/test_graph_completion_retriever.py (1)
173-237: Consider parameterizing repeated assertion patterns.Lines 180-236 contain many similar assertions checking for node headers, content blocks, and connections. This repetitive pattern could be refactored for maintainability.
Consider using parameterized checks:
expected_nodes = ["Steve Rodger", "Figma", "Ike Loma", "Jason Statham", "Mike Broski", "Canva", "Christina Mayer"] for node_name in expected_nodes: assert f"Node: {node_name}" in context, f"Missing node header for {node_name}" expected_descriptions = [ ("Steve Rodger", "This is description about Steve Rodger"), ("Figma", "Figma is a company"), # ... more entries ] for name, desc in expected_descriptions: expected_block = f"__node_content_start__\n{desc}\n__node_content_end__" assert expected_block in context, f"Description block for {name} altered" expected_connections = [ ("Steve Rodger", "works_for", "Figma"), # ... more entries ] for from_node, rel, to_node in expected_connections: expected_conn = f"{from_node} --[{rel}]--> {to_node}" assert expected_conn in context, f"Connection {from_node}→{to_node} missing or changed"This reduces duplication and makes it easier to maintain the test.
cognee/tests/integration/retrieval/test_chunks_retriever.py (2)
20-28: Consider extracting DocumentChunkWithEntities to shared test utilities.This test data model is duplicated in
cognee/tests/integration/retrieval/test_rag_completion_retriever.py(lines 20-28). Extract it to a shared test utilities module (e.g.,cognee/tests/fixtures/models.py) to follow the DRY principle and ensure consistency across integration tests.
31-200: Consider refactoring duplicated fixture setup/teardown logic.The three fixtures (
setup_test_environment_with_chunks_simple,setup_test_environment_with_chunks_complex,setup_test_environment_empty) share significant setup and teardown code:
- Path configuration (lines 34-36, 93-95, 184-186)
- System/data directory setup (lines 38-39, 97-98, 188-189)
- Prune and setup calls (lines 41-43, 100-102, 191-192)
- Cleanup logic (lines 83-87, 174-178, 196-200)
Consider extracting common fixture logic into a base fixture or helper function to reduce code duplication and improve maintainability.
cognee/tests/integration/retrieval/test_graph_completion_retriever_cot.py (1)
14-154: Consider refactoring duplicated fixture setup/teardown logic.Similar to
test_chunks_retriever.py, these fixtures share significant setup and teardown code. The path configuration, prune/setup calls, and cleanup logic are repeated across all three fixtures. Consider extracting common patterns into a base fixture or helper function.cognee/tests/integration/retrieval/test_rag_completion_retriever.py (2)
20-28: Consider extracting DocumentChunkWithEntities to shared test utilities.This test data model is duplicated from
cognee/tests/integration/retrieval/test_chunks_retriever.py(lines 20-28). Extract it to a shared test utilities module to follow the DRY principle.
31-204: Consider refactoring duplicated fixture setup/teardown logic.The three fixtures share significant setup and teardown code that could be extracted into a base fixture or helper function, similar to the patterns in other integration test files in this PR.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (24)
cognee/modules/retrieval/triplet_retriever.py(1 hunks)cognee/modules/retrieval/utils/brute_force_triplet_search.py(0 hunks)cognee/tests/integration/retrieval/test_chunks_retriever.py(1 hunks)cognee/tests/integration/retrieval/test_graph_completion_retriever.py(1 hunks)cognee/tests/integration/retrieval/test_graph_completion_retriever_context_extension.py(1 hunks)cognee/tests/integration/retrieval/test_graph_completion_retriever_cot.py(1 hunks)cognee/tests/integration/retrieval/test_rag_completion_retriever.py(1 hunks)cognee/tests/integration/retrieval/test_structured_output.py(2 hunks)cognee/tests/integration/retrieval/test_summaries_retriever.py(1 hunks)cognee/tests/integration/retrieval/test_temporal_retriever.py(1 hunks)cognee/tests/integration/retrieval/test_triplet_retriever.py(1 hunks)cognee/tests/unit/modules/retrieval/chunks_retriever_test.py(1 hunks)cognee/tests/unit/modules/retrieval/conversation_history_test.py(1 hunks)cognee/tests/unit/modules/retrieval/graph_completion_retriever_context_extension_test.py(1 hunks)cognee/tests/unit/modules/retrieval/graph_completion_retriever_cot_test.py(1 hunks)cognee/tests/unit/modules/retrieval/graph_completion_retriever_test.py(1 hunks)cognee/tests/unit/modules/retrieval/rag_completion_retriever_test.py(1 hunks)cognee/tests/unit/modules/retrieval/summaries_retriever_test.py(1 hunks)cognee/tests/unit/modules/retrieval/temporal_retriever_test.py(2 hunks)cognee/tests/unit/modules/retrieval/test_brute_force_triplet_search.py(3 hunks)cognee/tests/unit/modules/retrieval/test_completion.py(1 hunks)cognee/tests/unit/modules/retrieval/test_graph_summary_completion_retriever.py(1 hunks)cognee/tests/unit/modules/retrieval/test_user_qa_feedback.py(1 hunks)cognee/tests/unit/modules/retrieval/triplet_retriever_test.py(1 hunks)
💤 Files with no reviewable changes (1)
- cognee/modules/retrieval/utils/brute_force_triplet_search.py
🚧 Files skipped from review as they are similar to previous changes (1)
- cognee/tests/unit/modules/retrieval/summaries_retriever_test.py
🧰 Additional context used
📓 Path-based instructions (4)
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Use 4-space indentation in Python code
Use snake_case for Python module and function names
Use PascalCase for Python class names
Use ruff format before committing Python code
Use ruff check for import hygiene and style enforcement with line-length 100 configured in pyproject.toml
Prefer explicit, structured error handling in Python code
Files:
cognee/tests/integration/retrieval/test_graph_completion_retriever_cot.pycognee/tests/unit/modules/retrieval/test_brute_force_triplet_search.pycognee/tests/integration/retrieval/test_graph_completion_retriever_context_extension.pycognee/tests/unit/modules/retrieval/temporal_retriever_test.pycognee/tests/integration/retrieval/test_graph_completion_retriever.pycognee/tests/unit/modules/retrieval/chunks_retriever_test.pycognee/tests/unit/modules/retrieval/graph_completion_retriever_cot_test.pycognee/tests/integration/retrieval/test_summaries_retriever.pycognee/tests/unit/modules/retrieval/graph_completion_retriever_context_extension_test.pycognee/tests/integration/retrieval/test_rag_completion_retriever.pycognee/tests/integration/retrieval/test_chunks_retriever.pycognee/tests/unit/modules/retrieval/graph_completion_retriever_test.pycognee/tests/unit/modules/retrieval/test_graph_summary_completion_retriever.pycognee/tests/integration/retrieval/test_triplet_retriever.pycognee/tests/unit/modules/retrieval/triplet_retriever_test.pycognee/tests/unit/modules/retrieval/test_user_qa_feedback.pycognee/tests/unit/modules/retrieval/conversation_history_test.pycognee/tests/integration/retrieval/test_structured_output.pycognee/modules/retrieval/triplet_retriever.pycognee/tests/unit/modules/retrieval/test_completion.pycognee/tests/unit/modules/retrieval/rag_completion_retriever_test.pycognee/tests/integration/retrieval/test_temporal_retriever.py
⚙️ CodeRabbit configuration file
**/*.py: When reviewing Python code for this project:
- Prioritize portability over clarity, especially when dealing with cross-Python compatibility. However, with the priority in mind, do still consider improvements to clarity when relevant.
- As a general guideline, consider the code style advocated in the PEP 8 standard (excluding the use of spaces for indentation) and evaluate suggested changes for code style compliance.
- As a style convention, consider the code style advocated in CEP-8 and evaluate suggested changes for code style compliance.
- As a general guideline, try to provide any relevant, official, and supporting documentation links to any tool's suggestions in review comments. This guideline is important for posterity.
- As a general rule, undocumented function definitions and class definitions in the project's Python code are assumed incomplete. Please consider suggesting a short summary of the code for any of these incomplete definitions as docstrings when reviewing.
Files:
cognee/tests/integration/retrieval/test_graph_completion_retriever_cot.pycognee/tests/unit/modules/retrieval/test_brute_force_triplet_search.pycognee/tests/integration/retrieval/test_graph_completion_retriever_context_extension.pycognee/tests/unit/modules/retrieval/temporal_retriever_test.pycognee/tests/integration/retrieval/test_graph_completion_retriever.pycognee/tests/unit/modules/retrieval/chunks_retriever_test.pycognee/tests/unit/modules/retrieval/graph_completion_retriever_cot_test.pycognee/tests/integration/retrieval/test_summaries_retriever.pycognee/tests/unit/modules/retrieval/graph_completion_retriever_context_extension_test.pycognee/tests/integration/retrieval/test_rag_completion_retriever.pycognee/tests/integration/retrieval/test_chunks_retriever.pycognee/tests/unit/modules/retrieval/graph_completion_retriever_test.pycognee/tests/unit/modules/retrieval/test_graph_summary_completion_retriever.pycognee/tests/integration/retrieval/test_triplet_retriever.pycognee/tests/unit/modules/retrieval/triplet_retriever_test.pycognee/tests/unit/modules/retrieval/test_user_qa_feedback.pycognee/tests/unit/modules/retrieval/conversation_history_test.pycognee/tests/integration/retrieval/test_structured_output.pycognee/modules/retrieval/triplet_retriever.pycognee/tests/unit/modules/retrieval/test_completion.pycognee/tests/unit/modules/retrieval/rag_completion_retriever_test.pycognee/tests/integration/retrieval/test_temporal_retriever.py
cognee/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Use shared logging utilities from cognee.shared.logging_utils in Python code
Files:
cognee/tests/integration/retrieval/test_graph_completion_retriever_cot.pycognee/tests/unit/modules/retrieval/test_brute_force_triplet_search.pycognee/tests/integration/retrieval/test_graph_completion_retriever_context_extension.pycognee/tests/unit/modules/retrieval/temporal_retriever_test.pycognee/tests/integration/retrieval/test_graph_completion_retriever.pycognee/tests/unit/modules/retrieval/chunks_retriever_test.pycognee/tests/unit/modules/retrieval/graph_completion_retriever_cot_test.pycognee/tests/integration/retrieval/test_summaries_retriever.pycognee/tests/unit/modules/retrieval/graph_completion_retriever_context_extension_test.pycognee/tests/integration/retrieval/test_rag_completion_retriever.pycognee/tests/integration/retrieval/test_chunks_retriever.pycognee/tests/unit/modules/retrieval/graph_completion_retriever_test.pycognee/tests/unit/modules/retrieval/test_graph_summary_completion_retriever.pycognee/tests/integration/retrieval/test_triplet_retriever.pycognee/tests/unit/modules/retrieval/triplet_retriever_test.pycognee/tests/unit/modules/retrieval/test_user_qa_feedback.pycognee/tests/unit/modules/retrieval/conversation_history_test.pycognee/tests/integration/retrieval/test_structured_output.pycognee/modules/retrieval/triplet_retriever.pycognee/tests/unit/modules/retrieval/test_completion.pycognee/tests/unit/modules/retrieval/rag_completion_retriever_test.pycognee/tests/integration/retrieval/test_temporal_retriever.py
cognee/tests/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
cognee/tests/**/*.py: Place Python tests under cognee/tests/ organized by type (unit, integration, cli_tests)
Name Python test files test_*.py and use pytest.mark.asyncio for async tests
Files:
cognee/tests/integration/retrieval/test_graph_completion_retriever_cot.pycognee/tests/unit/modules/retrieval/test_brute_force_triplet_search.pycognee/tests/integration/retrieval/test_graph_completion_retriever_context_extension.pycognee/tests/unit/modules/retrieval/temporal_retriever_test.pycognee/tests/integration/retrieval/test_graph_completion_retriever.pycognee/tests/unit/modules/retrieval/chunks_retriever_test.pycognee/tests/unit/modules/retrieval/graph_completion_retriever_cot_test.pycognee/tests/integration/retrieval/test_summaries_retriever.pycognee/tests/unit/modules/retrieval/graph_completion_retriever_context_extension_test.pycognee/tests/integration/retrieval/test_rag_completion_retriever.pycognee/tests/integration/retrieval/test_chunks_retriever.pycognee/tests/unit/modules/retrieval/graph_completion_retriever_test.pycognee/tests/unit/modules/retrieval/test_graph_summary_completion_retriever.pycognee/tests/integration/retrieval/test_triplet_retriever.pycognee/tests/unit/modules/retrieval/triplet_retriever_test.pycognee/tests/unit/modules/retrieval/test_user_qa_feedback.pycognee/tests/unit/modules/retrieval/conversation_history_test.pycognee/tests/integration/retrieval/test_structured_output.pycognee/tests/unit/modules/retrieval/test_completion.pycognee/tests/unit/modules/retrieval/rag_completion_retriever_test.pycognee/tests/integration/retrieval/test_temporal_retriever.py
cognee/{modules,infrastructure,tasks}/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Co-locate feature-specific helpers under their respective package (modules/, infrastructure/, or tasks/)
Files:
cognee/modules/retrieval/triplet_retriever.py
🧠 Learnings (2)
📚 Learning: 2025-11-24T16:45:09.996Z
Learnt from: CR
Repo: topoteretes/cognee PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:45:09.996Z
Learning: Applies to cognee/tests/**/*.py : Name Python test files test_*.py and use pytest.mark.asyncio for async tests
Applied to files:
cognee/tests/integration/retrieval/test_graph_completion_retriever_cot.pycognee/tests/integration/retrieval/test_graph_completion_retriever_context_extension.pycognee/tests/integration/retrieval/test_structured_output.py
📚 Learning: 2024-11-13T14:55:05.912Z
Learnt from: 0xideas
Repo: topoteretes/cognee PR: 205
File: cognee/tests/unit/processing/chunks/chunk_by_paragraph_test.py:7-7
Timestamp: 2024-11-13T14:55:05.912Z
Learning: When changes are made to the chunking implementation in `cognee/tasks/chunks`, the ground truth values in the corresponding tests in `cognee/tests/unit/processing/chunks` need to be updated accordingly.
Applied to files:
cognee/tests/unit/modules/retrieval/chunks_retriever_test.pycognee/tests/integration/retrieval/test_rag_completion_retriever.pycognee/tests/integration/retrieval/test_chunks_retriever.py
🧬 Code graph analysis (18)
cognee/tests/integration/retrieval/test_graph_completion_retriever_cot.py (4)
cognee/infrastructure/engine/models/DataPoint.py (1)
DataPoint(20-220)cognee/modules/retrieval/graph_completion_cot_retriever.py (1)
GraphCompletionCotRetriever(39-239)cognee/api/v1/config/config.py (1)
system_root_directory(18-33)cognee/modules/retrieval/graph_completion_retriever.py (1)
get_triplets(80-116)
cognee/tests/unit/modules/retrieval/test_brute_force_triplet_search.py (1)
cognee/modules/retrieval/utils/brute_force_triplet_search.py (3)
brute_force_triplet_search(76-199)get_memory_fragment(39-73)format_triplets(18-36)
cognee/tests/integration/retrieval/test_graph_completion_retriever_context_extension.py (1)
cognee/modules/retrieval/graph_completion_context_extension_retriever.py (1)
GraphCompletionContextExtensionRetriever(17-178)
cognee/tests/integration/retrieval/test_graph_completion_retriever.py (2)
cognee/infrastructure/engine/models/DataPoint.py (1)
DataPoint(20-220)cognee/modules/retrieval/graph_completion_retriever.py (2)
GraphCompletionRetriever(28-294)get_triplets(80-116)
cognee/tests/unit/modules/retrieval/graph_completion_retriever_cot_test.py (1)
cognee/modules/retrieval/graph_completion_cot_retriever.py (4)
GraphCompletionCotRetriever(39-239)_as_answer_text(25-36)_run_cot_completion(87-169)get_completion(171-239)
cognee/tests/integration/retrieval/test_summaries_retriever.py (2)
cognee/modules/retrieval/exceptions/exceptions.py (1)
NoDataError(25-32)cognee/modules/retrieval/summaries_retriever.py (1)
SummariesRetriever(12-101)
cognee/tests/integration/retrieval/test_rag_completion_retriever.py (5)
cognee/modules/data/processing/document_types/TextDocument.py (1)
TextDocument(6-22)cognee/modules/retrieval/exceptions/exceptions.py (1)
NoDataError(25-32)cognee/modules/retrieval/completion_retriever.py (1)
CompletionRetriever(20-147)cognee/infrastructure/engine/models/DataPoint.py (1)
DataPoint(20-220)cognee/api/v1/config/config.py (2)
system_root_directory(18-33)data_root_directory(36-38)
cognee/tests/integration/retrieval/test_chunks_retriever.py (5)
cognee/modules/data/processing/document_types/TextDocument.py (1)
TextDocument(6-22)cognee/modules/retrieval/exceptions/exceptions.py (1)
NoDataError(25-32)cognee/modules/retrieval/chunks_retriever.py (1)
ChunksRetriever(12-101)cognee/infrastructure/engine/models/DataPoint.py (1)
DataPoint(20-220)cognee/api/v1/config/config.py (2)
system_root_directory(18-33)data_root_directory(36-38)
cognee/tests/unit/modules/retrieval/graph_completion_retriever_test.py (4)
cognee/modules/retrieval/graph_completion_retriever.py (7)
GraphCompletionRetriever(28-294)get_triplets(80-116)get_context(118-148)resolve_edges_to_text(64-78)convert_retrieved_objects_to_context(150-152)get_completion(154-228)save_qa(230-294)cognee/modules/retrieval/base_graph_retriever.py (2)
get_context(11-13)get_completion(16-24)cognee/modules/retrieval/base_retriever.py (2)
get_context(9-11)get_completion(14-22)cognee/modules/retrieval/completion_retriever.py (2)
get_context(42-75)get_completion(77-147)
cognee/tests/unit/modules/retrieval/test_graph_summary_completion_retriever.py (2)
cognee/modules/retrieval/graph_summary_completion_retriever.py (1)
GraphSummaryCompletionRetriever(7-66)cognee-mcp/src/server.py (1)
save_interaction(260-315)
cognee/tests/integration/retrieval/test_triplet_retriever.py (2)
cognee/modules/retrieval/triplet_retriever.py (1)
get_context(42-80)cognee/modules/retrieval/exceptions/exceptions.py (1)
NoDataError(25-32)
cognee/tests/unit/modules/retrieval/triplet_retriever_test.py (1)
cognee/modules/retrieval/triplet_retriever.py (2)
get_context(42-80)get_completion(82-132)
cognee/tests/unit/modules/retrieval/test_user_qa_feedback.py (2)
cognee/modules/retrieval/user_qa_feedback.py (1)
UserQAFeedback(16-84)cognee/modules/retrieval/utils/models.py (2)
UserFeedbackEvaluation(34-40)UserFeedbackSentiment(26-31)
cognee/tests/unit/modules/retrieval/conversation_history_test.py (2)
cognee/modules/retrieval/utils/session_cache.py (2)
save_conversation_history(10-75)get_conversation_history(78-156)cognee/infrastructure/databases/exceptions/exceptions.py (1)
CacheConnectionError(137-150)
cognee/tests/integration/retrieval/test_structured_output.py (3)
cognee/api/v1/config/config.py (2)
system_root_directory(18-33)data_root_directory(36-38)cognee/infrastructure/engine/models/DataPoint.py (1)
DataPoint(20-220)cognee/modules/data/processing/document_types/TextDocument.py (1)
TextDocument(6-22)
cognee/tests/unit/modules/retrieval/test_completion.py (1)
cognee/modules/retrieval/utils/completion.py (1)
generate_completion(6-28)
cognee/tests/unit/modules/retrieval/rag_completion_retriever_test.py (3)
cognee/modules/retrieval/completion_retriever.py (3)
CompletionRetriever(20-147)get_context(42-75)get_completion(77-147)cognee/modules/retrieval/exceptions/exceptions.py (1)
NoDataError(25-32)cognee/infrastructure/databases/vector/exceptions/exceptions.py (1)
CollectionNotFoundError(5-22)
cognee/tests/integration/retrieval/test_temporal_retriever.py (2)
cognee/infrastructure/engine/models/DataPoint.py (1)
DataPoint(20-220)cognee/api/v1/config/config.py (2)
system_root_directory(18-33)data_root_directory(36-38)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (199)
- GitHub Check: End-to-End Tests / Concurrent Subprocess access test
- GitHub Check: End-to-End Tests / Conversation sessions test (FS)
- GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
- GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Entity Extraction
- GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
- GitHub Check: End-to-End Tests / Test using different async databases in parallel in Cognee
- GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
- GitHub Check: End-to-End Tests / Test Feedback Enrichment
- GitHub Check: Basic Tests / Run Simple Examples
- GitHub Check: End-to-End Tests / Deduplication Test
- GitHub Check: End-to-End Tests / Test graph edge ingestion
- GitHub Check: End-to-End Tests / Server Start Test
- GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
- GitHub Check: Basic Tests / Run Simple Examples BAML
- GitHub Check: Basic Tests / Run Integration Tests
- GitHub Check: Basic Tests / Run Unit Tests
- GitHub Check: End-to-End Tests / S3 Bucket Test
- GitHub Check: CLI Tests / CLI Integration Tests
- GitHub Check: CLI Tests / CLI Functionality Tests
- GitHub Check: End-to-End Tests / Concurrent Subprocess access test
- GitHub Check: End-to-End Tests / Conversation sessions test (FS)
- GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
- GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Entity Extraction
- GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
- GitHub Check: End-to-End Tests / Test using different async databases in parallel in Cognee
- GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
- GitHub Check: End-to-End Tests / Test Feedback Enrichment
- GitHub Check: Basic Tests / Run Simple Examples
- GitHub Check: End-to-End Tests / Deduplication Test
- GitHub Check: End-to-End Tests / Test graph edge ingestion
- GitHub Check: End-to-End Tests / Server Start Test
- GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
- GitHub Check: Basic Tests / Run Simple Examples BAML
- GitHub Check: Basic Tests / Run Integration Tests
- GitHub Check: Basic Tests / Run Unit Tests
- GitHub Check: End-to-End Tests / S3 Bucket Test
- GitHub Check: CLI Tests / CLI Integration Tests
- GitHub Check: CLI Tests / CLI Functionality Tests
- GitHub Check: End-to-End Tests / Concurrent Subprocess access test
- GitHub Check: End-to-End Tests / Conversation sessions test (FS)
- GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
- GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Entity Extraction
- GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
- GitHub Check: End-to-End Tests / Test using different async databases in parallel in Cognee
- GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
- GitHub Check: End-to-End Tests / Test Feedback Enrichment
- GitHub Check: Basic Tests / Run Simple Examples
- GitHub Check: End-to-End Tests / Deduplication Test
- GitHub Check: End-to-End Tests / Test graph edge ingestion
- GitHub Check: End-to-End Tests / Server Start Test
- GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
- GitHub Check: Basic Tests / Run Simple Examples BAML
- GitHub Check: Basic Tests / Run Integration Tests
- GitHub Check: Basic Tests / Run Unit Tests
- GitHub Check: End-to-End Tests / S3 Bucket Test
- GitHub Check: CLI Tests / CLI Integration Tests
- GitHub Check: CLI Tests / CLI Functionality Tests
- GitHub Check: End-to-End Tests / Concurrent Subprocess access test
- GitHub Check: End-to-End Tests / Conversation sessions test (FS)
- GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
- GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Entity Extraction
- GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
- GitHub Check: End-to-End Tests / Test using different async databases in parallel in Cognee
- GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
- GitHub Check: End-to-End Tests / Test Feedback Enrichment
- GitHub Check: Basic Tests / Run Simple Examples
- GitHub Check: End-to-End Tests / Deduplication Test
- GitHub Check: End-to-End Tests / Test graph edge ingestion
- GitHub Check: End-to-End Tests / Server Start Test
- GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
- GitHub Check: Basic Tests / Run Simple Examples BAML
- GitHub Check: Basic Tests / Run Integration Tests
- GitHub Check: Basic Tests / Run Unit Tests
- GitHub Check: End-to-End Tests / S3 Bucket Test
- GitHub Check: CLI Tests / CLI Integration Tests
- GitHub Check: CLI Tests / CLI Functionality Tests
- GitHub Check: End-to-End Tests / Concurrent Subprocess access test
- GitHub Check: End-to-End Tests / Conversation sessions test (FS)
- GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
- GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Entity Extraction
- GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
- GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
- GitHub Check: End-to-End Tests / Test Feedback Enrichment
- GitHub Check: Basic Tests / Run Simple Examples
- GitHub Check: End-to-End Tests / Deduplication Test
- GitHub Check: End-to-End Tests / Test graph edge ingestion
- GitHub Check: End-to-End Tests / Server Start Test
- GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
- GitHub Check: Basic Tests / Run Simple Examples BAML
- GitHub Check: Basic Tests / Run Integration Tests
- GitHub Check: Basic Tests / Run Unit Tests
- GitHub Check: End-to-End Tests / S3 Bucket Test
- GitHub Check: CLI Tests / CLI Integration Tests
- GitHub Check: CLI Tests / CLI Functionality Tests
- GitHub Check: End-to-End Tests / Concurrent Subprocess access test
- GitHub Check: End-to-End Tests / Conversation sessions test (FS)
- GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
- GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Entity Extraction
- GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
- GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
- GitHub Check: End-to-End Tests / Test Feedback Enrichment
- GitHub Check: Basic Tests / Run Simple Examples
- GitHub Check: End-to-End Tests / Deduplication Test
- GitHub Check: End-to-End Tests / Test graph edge ingestion
- GitHub Check: End-to-End Tests / Server Start Test
- GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
- GitHub Check: Basic Tests / Run Integration Tests
- GitHub Check: Basic Tests / Run Unit Tests
- GitHub Check: End-to-End Tests / S3 Bucket Test
- GitHub Check: CLI Tests / CLI Integration Tests
- GitHub Check: CLI Tests / CLI Functionality Tests
- GitHub Check: End-to-End Tests / Concurrent Subprocess access test
- GitHub Check: End-to-End Tests / Conversation sessions test (FS)
- GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
- GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Entity Extraction
- GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
- GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
- GitHub Check: End-to-End Tests / Test Feedback Enrichment
- GitHub Check: Basic Tests / Run Simple Examples
- GitHub Check: End-to-End Tests / Deduplication Test
- GitHub Check: End-to-End Tests / Test graph edge ingestion
- GitHub Check: End-to-End Tests / Server Start Test
- GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
- GitHub Check: Basic Tests / Run Integration Tests
- GitHub Check: Basic Tests / Run Unit Tests
- GitHub Check: End-to-End Tests / S3 Bucket Test
- GitHub Check: CLI Tests / CLI Integration Tests
- GitHub Check: CLI Tests / CLI Functionality Tests
- GitHub Check: End-to-End Tests / Concurrent Subprocess access test
- GitHub Check: End-to-End Tests / Conversation sessions test (FS)
- GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
- GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Entity Extraction
- GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
- GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
- GitHub Check: End-to-End Tests / Test Feedback Enrichment
- GitHub Check: Basic Tests / Run Simple Examples
- GitHub Check: End-to-End Tests / Deduplication Test
- GitHub Check: End-to-End Tests / Test graph edge ingestion
- GitHub Check: End-to-End Tests / Server Start Test
- GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
- GitHub Check: Basic Tests / Run Integration Tests
- GitHub Check: Basic Tests / Run Unit Tests
- GitHub Check: End-to-End Tests / S3 Bucket Test
- GitHub Check: CLI Tests / CLI Integration Tests
- GitHub Check: CLI Tests / CLI Functionality Tests
- GitHub Check: End-to-End Tests / Concurrent Subprocess access test
- GitHub Check: End-to-End Tests / Conversation sessions test (FS)
- GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
- GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Entity Extraction
- GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
- GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
- GitHub Check: End-to-End Tests / Test Feedback Enrichment
- GitHub Check: Basic Tests / Run Simple Examples
- GitHub Check: End-to-End Tests / Deduplication Test
- GitHub Check: End-to-End Tests / Test graph edge ingestion
- GitHub Check: End-to-End Tests / Server Start Test
- GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
- GitHub Check: Basic Tests / Run Integration Tests
- GitHub Check: Basic Tests / Run Unit Tests
- GitHub Check: End-to-End Tests / S3 Bucket Test
- GitHub Check: CLI Tests / CLI Integration Tests
- GitHub Check: CLI Tests / CLI Functionality Tests
- GitHub Check: End-to-End Tests / Concurrent Subprocess access test
- GitHub Check: End-to-End Tests / Conversation sessions test (FS)
- GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
- GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Entity Extraction
- GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
- GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
- GitHub Check: End-to-End Tests / Test Feedback Enrichment
- GitHub Check: Basic Tests / Run Simple Examples
- GitHub Check: End-to-End Tests / Deduplication Test
- GitHub Check: End-to-End Tests / Test graph edge ingestion
- GitHub Check: End-to-End Tests / Server Start Test
- GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
- GitHub Check: Basic Tests / Run Integration Tests
- GitHub Check: Basic Tests / Run Unit Tests
- GitHub Check: End-to-End Tests / S3 Bucket Test
- GitHub Check: CLI Tests / CLI Integration Tests
- GitHub Check: CLI Tests / CLI Functionality Tests
cognee/tests/integration/retrieval/test_graph_completion_retriever_context_extension.py
Show resolved
Hide resolved
…rs-tests-reorg` Docstrings generation was requested by @hajdul88. * #1881 (comment) The following files were modified: * `cognee/modules/retrieval/triplet_retriever.py` * `cognee/modules/retrieval/utils/brute_force_triplet_search.py` * `cognee/tests/integration/retrieval/test_chunks_retriever.py` * `cognee/tests/integration/retrieval/test_graph_completion_retriever.py` * `cognee/tests/integration/retrieval/test_graph_completion_retriever_context_extension.py` * `cognee/tests/integration/retrieval/test_graph_completion_retriever_cot.py` * `cognee/tests/integration/retrieval/test_rag_completion_retriever.py` * `cognee/tests/integration/retrieval/test_structured_output.py` * `cognee/tests/integration/retrieval/test_summaries_retriever.py` * `cognee/tests/integration/retrieval/test_temporal_retriever.py` * `cognee/tests/unit/modules/retrieval/test_graph_summary_completion_retriever.py` * `cognee/tests/unit/modules/retrieval/test_user_qa_feedback.py`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
cognee/tests/unit/eval_framework/corpus_builder_test.py (1)
9-23: Consider sharingMOCK_HOTPOT_CORPUSacross test modules to avoid drift.You now define an identical
MOCK_HOTPOT_CORPUSin multiple files. A small shared fixture/helper (e.g.,cognee/tests/unit/eval_framework/fixtures.py) would reduce duplication and keep Hotpot/TwoWiki expectations aligned.
(If you want an “official” pattern: pytest fixtures docs are here.)https://docs.pytest.org/en/stable/how-to/fixtures.html
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
cognee/tests/unit/eval_framework/benchmark_adapters_test.py(3 hunks)cognee/tests/unit/eval_framework/corpus_builder_test.py(2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Use 4-space indentation in Python code
Use snake_case for Python module and function names
Use PascalCase for Python class names
Use ruff format before committing Python code
Use ruff check for import hygiene and style enforcement with line-length 100 configured in pyproject.toml
Prefer explicit, structured error handling in Python code
Files:
cognee/tests/unit/eval_framework/corpus_builder_test.pycognee/tests/unit/eval_framework/benchmark_adapters_test.py
⚙️ CodeRabbit configuration file
**/*.py: When reviewing Python code for this project:
- Prioritize portability over clarity, especially when dealing with cross-Python compatibility. However, with the priority in mind, do still consider improvements to clarity when relevant.
- As a general guideline, consider the code style advocated in the PEP 8 standard (excluding the use of spaces for indentation) and evaluate suggested changes for code style compliance.
- As a style convention, consider the code style advocated in CEP-8 and evaluate suggested changes for code style compliance.
- As a general guideline, try to provide any relevant, official, and supporting documentation links to any tool's suggestions in review comments. This guideline is important for posterity.
- As a general rule, undocumented function definitions and class definitions in the project's Python code are assumed incomplete. Please consider suggesting a short summary of the code for any of these incomplete definitions as docstrings when reviewing.
Files:
cognee/tests/unit/eval_framework/corpus_builder_test.pycognee/tests/unit/eval_framework/benchmark_adapters_test.py
cognee/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Use shared logging utilities from cognee.shared.logging_utils in Python code
Files:
cognee/tests/unit/eval_framework/corpus_builder_test.pycognee/tests/unit/eval_framework/benchmark_adapters_test.py
cognee/tests/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
cognee/tests/**/*.py: Place Python tests under cognee/tests/ organized by type (unit, integration, cli_tests)
Name Python test files test_*.py and use pytest.mark.asyncio for async tests
Files:
cognee/tests/unit/eval_framework/corpus_builder_test.pycognee/tests/unit/eval_framework/benchmark_adapters_test.py
🧬 Code graph analysis (2)
cognee/tests/unit/eval_framework/corpus_builder_test.py (1)
cognee/eval_framework/corpus_builder/corpus_builder_executor.py (3)
CorpusBuilderExecutor(13-67)load_corpus(32-41)build_corpus(43-55)
cognee/tests/unit/eval_framework/benchmark_adapters_test.py (1)
cognee/eval_framework/corpus_builder/corpus_builder_executor.py (1)
load_corpus(32-41)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
- GitHub Check: End-to-End Tests / Concurrent Subprocess access test
- GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
- GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
- GitHub Check: End-to-End Tests / Test Entity Extraction
- GitHub Check: End-to-End Tests / Conversation sessions test (FS)
- GitHub Check: End-to-End Tests / Test Feedback Enrichment
- GitHub Check: End-to-End Tests / S3 Bucket Test
- GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
- GitHub Check: End-to-End Tests / Server Start Test
- GitHub Check: Basic Tests / Run Integration Tests
- GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
- GitHub Check: End-to-End Tests / Deduplication Test
- GitHub Check: End-to-End Tests / Test graph edge ingestion
- GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
- GitHub Check: End-to-End Tests / Test using different async databases in parallel in Cognee
- GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
- GitHub Check: Basic Tests / Run Simple Examples BAML
- GitHub Check: Basic Tests / Run Unit Tests
- GitHub Check: Basic Tests / Run Simple Examples
- GitHub Check: CLI Tests / CLI Functionality Tests
- GitHub Check: CLI Tests / CLI Integration Tests
🔇 Additional comments (1)
cognee/tests/unit/eval_framework/benchmark_adapters_test.py (1)
54-58: Adapter-specific patching is correct; both_get_raw_corpusandload_corpus()are properly handled.The patching strategy is sound:
_get_raw_corpus()is synchronous in both HotpotQAAdapter and TwoWikiMultihopAdapter, so usingpatch.object()withreturn_value(notAsyncMock) is correct. Theload_corpus()method returnsTuple[List[str], List[dict[str, Any]]]as expected, and test assertions at lines 63–70 and 96–100 correctly unpack and validate this structure. No type mismatches or flakes are present.
pazone
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
lxobr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks alright, nice work
…evers-tests-reorg
…evers-tests-reorg
Thanks lets merge this after the release because its connected to step 1.5 and 2. |
…evers-tests-reorg
Description
This PR restructures/adds integration and unit tests for the retrieval module.
-Old integration tests were updated and moved under unit tests + fixtures added
-Added missing unit tests for all core retrieval business logic
-Covered 100% of the core retrievers with tests
-Minor changes (dead code deletion, typo fixed)
Type of Change
Screenshots/Videos (if applicable)
Pre-submission Checklist
DCO Affirmation
I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
Summary by CodeRabbit
Changes
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.