-
Notifications
You must be signed in to change notification settings - Fork 1.6k
add image indexing tests #4477
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 image indexing tests #4477
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
PR Summary
This PR adds an image indexing integration test while updating settings API endpoints, file upload utilities, and test models to support image extraction and analysis.
- Modified
/backend/tests/integration/common_utils/managers/settings.py
to remove outdated endpoint prefixes. - Added
/backend/tests/integration/common_utils/connectors.py
to handle file uploads with robust error handling. - Updated
/backend/tests/integration/common_utils/test_models.py
by adding new boolean fields in DATestSettings. - Changed REST endpoint in
/backend/onyx/server/settings/api.py
from PUT to PATCH for partial updates. - Introduced
/backend/tests/integration/tests/image_indexing/indexing_images.py
for end-to-end image indexing verification.
5 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
test_file_dir = "tests/integration/common_utils/test_data" | ||
os.makedirs(test_file_dir, exist_ok=True) | ||
test_file_path = os.path.join(test_file_dir, "sample.pdf") |
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.
logic: Test assumes sample.pdf exists. Verify file presence or handle missing file scenarios.
test_file_dir = "tests/integration/common_utils/test_data" | |
os.makedirs(test_file_dir, exist_ok=True) | |
test_file_path = os.path.join(test_file_dir, "sample.pdf") | |
test_file_dir = "tests/integration/common_utils/test_data" | |
os.makedirs(test_file_dir, exist_ok=True) | |
test_file_path = os.path.join(test_file_dir, "sample.pdf") | |
assert os.path.exists(test_file_path), f"Test file {test_file_path} not found" |
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 with a few nits
and default_provider.default_vision_model | ||
and model_supports_image_input( | ||
if default_provider and default_provider.default_vision_model: | ||
if model_supports_image_input( |
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.
prefer keeping these if's together with and
# Safely get groups - handle detached instance case | ||
try: | ||
groups = [group.id for group in llm_provider_model.groups] | ||
except Exception: |
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.
would prefer catching the exact exception described in the comment, but all good if you really don't want errors here
connector_id=connector.id, | ||
access_type=AccessType.PUBLIC, | ||
user_performing_action=admin_user, | ||
) |
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.
I feel like we should really have a utility that simplifies creating and linking credentials and connectors, more of a TODO item though
7937c6d
to
62d3f92
Compare
Description
Fixes https://linear.app/danswer/issue/DAN-1768/image-indexing-flow-tests
How Has This Been Tested?
[Describe the tests you ran to verify your changes]
Backporting (check the box to trigger backport action)
Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.