-
Notifications
You must be signed in to change notification settings - Fork 836
Add Tests #377
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
Add Tests #377
Conversation
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.
❌ Changes requested. Reviewed everything up to 8c2f234 in 1 minute and 45 seconds
More details
- Looked at
859
lines of code in8
files - Skipped
1
files when reviewing. - Skipped posting
7
drafted comments based on config settings.
1. .coveragerc:5
- Draft comment:
Typo in main condition; use "if name == 'main':". - Reason this comment was not posted:
Marked as duplicate.
2. pytest.ini:21
- Draft comment:
Typo in main condition; use "if name == 'main':". - Reason this comment was not posted:
Marked as duplicate.
3. .coveragerc:5
- Draft comment:
The exclusion pattern for the main guard appears malformed. Consider using the proper regex, e.g. "if name == 'main':". - Reason this comment was not posted:
Marked as duplicate.
4. pytest.ini:21
- Draft comment:
The exclusion pattern for the main guard is repeated here and is malformed. It likely should be "if name == 'main':". - Reason this comment was not posted:
Marked as duplicate.
5. tests/embedder/test_embedder_gemini.py:147
- Draft comment:
The test wraps the list input in an extra list. Confirm this behavior is intended and document it if so. - Reason this comment was not posted:
Confidence changes required:80%
<= threshold80%
None
6. tests/embedder/test_embedder_voyage.py:175
- Draft comment:
Mixed-type inputs like an integer (123) are being converted to a string. Confirm that this conversion aligns with the desired behavior and consider documenting it. - Reason this comment was not posted:
Confidence changes required:80%
<= threshold80%
None
7. tests/embedder/test_embedder_openai.py:159
- Draft comment:
Patching of environment variables using mocker.patch.dict may affect parallel tests. Consider using a dedicated fixture to manage environment variables safely. - Reason this comment was not posted:
Confidence changes required:70%
<= threshold80%
None
Workflow ID: wflow_oNNclNnBMJVthzcg
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
limitations under the License. | ||
""" | ||
|
||
# Running tests: pytest -xvs tests/embedder/test_client.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.
Typographical inconsistency: The comment on lines 17-18 mentions tests/embedder/test_client.py
, while the actual file name is test_embedder_client.py
. Please update the comment to the correct file name.
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.
fixed
This PR partially addresses issue #375 but does not fully resolve it. |
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Issues with adding test coverage. |
Add Testing for Embedder Module
Overview
This PR adds tests for the embedder directory in graphiti-core, increasing it from 0% to 96%. The changes include test suites for all embedder implementations (OpenAI, Gemini, and VoyageAI) as well as the base embedder client.
Key Changes
Project
pyproject.toml
Base Embedder Client Tests
EmbedderClient
abstract classMinimalEmbedderClient
for testing inheritanceOpenAI Embedder Tests
Gemini Embedder Tests
VoyageAI Embedder Tests
Testing Details
Impact
I have read the CLA Document and I hereby sign the CLA
Important
Add comprehensive tests for embedder module, increasing coverage to 96%, and update testing configurations.
EmbedderClient
abstract class andMinimalEmbedderClient
intest_embedder_client.py
.GeminiEmbedder
intest_embedder_gemini.py
, covering initialization, custom config, string and list inputs.OpenAIEmbedder
intest_embedder_openai.py
, covering string and list inputs, custom client, default config, and environment variable API key.VoyageAIEmbedder
intest_embedder_voyage.py
, covering initialization, custom config, string and list inputs, empty input, and mixed types.pytest-cov
andpytest-mock
as dev dependencies inpyproject.toml
..coveragerc
for coverage configuration.pytest.ini
for test discovery and coverage reporting.pyproject.toml
for consistency.This description was created by
for 8c2f234. It will automatically update as commits are pushed.