-
Notifications
You must be signed in to change notification settings - Fork 186
Fix OpenAI RAG integration tests: Replace Wikimedia image URL with Unsplash #4472
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
Conversation
Signed-off-by: rithin-pullela-aws <rithinp@amazon.com>
WalkthroughTest integration file modified to update image data URLs in two test methods from Wikimedia hosting to Unsplash. Only test data values changed; no logic, control flow, or error handling modifications. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. 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.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
plugin/src/test/java/org/opensearch/ml/rest/RestMLRAGSearchProcessorIT.java (1)
707-731: Fix response variable mix‑ups so this new URL path is actually exercisedThe new Unsplash URL at Line 719 looks fine for
imageType = "url"and matches the intent to avoid the Wikimedia backend issue. However, the second request block isn’t really validated because it still uses the first response everywhere:
- Line 721 asserts on
response2instead ofresponse3.- Line 724 reads
extfromresponseMap2instead ofresponseMap3.That means the assertions never check the result of the URL‑based image request.
Suggested patch:
requestParameters.imageType = "url"; - requestParameters.imageData = "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=800"; - Response response3 = performSearch(INDEX_NAME, "pipeline_test", 5, requestParameters); - assertEquals(200, response2.getStatusLine().getStatusCode()); - - Map responseMap3 = parseResponseToMap(response3); - ext = (Map) responseMap2.get("ext"); + requestParameters.imageData = "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=800"; + Response response3 = performSearch(INDEX_NAME, "pipeline_test", 5, requestParameters); + assertEquals(200, response3.getStatusLine().getStatusCode()); + + Map responseMap3 = parseResponseToMap(response3); + ext = (Map) responseMap3.get("ext");This makes the second half of the test actually validate the new URL flow.
🧹 Nitpick comments (1)
plugin/src/test/java/org/opensearch/ml/rest/RestMLRAGSearchProcessorIT.java (1)
1060-1073: URL update looks good; consider deduplicating the test image URLUsing the Unsplash URL at Line 1072 is consistent with the earlier test and with
imageType = "url". To avoid drift and simplify future changes, consider extracting this URL into a singlestatic finalconstant (e.g.,TEST_IMAGE_URL) and reusing it in both tests.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
plugin/src/test/java/org/opensearch/ml/rest/RestMLRAGSearchProcessorIT.java(2 hunks)
| requestParameters.imageType = "url"; | ||
| requestParameters.imageData = | ||
| "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"; // imageContent; | ||
| requestParameters.imageData = "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=800"; |
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.
Just curious why do need to download the image? What is the goal of this integration test?
Can we keep an image in our resources folder? What if this image link breaks again?
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.
This particular IT covers the case where a URL is sent to OpenAI instead of Base 64 local image. We already have a test that covers local image (line 664)
|
CI fails because of no space on disk: |
|
try run the CI once at a time to avoid the disk issue |
|
CI failed with: |
|
It's still failing with timeout: |
|
The backport to To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-3.3 3.3
# Navigate to the new working tree
cd .worktrees/backport-3.3
# Create a new branch
git switch --create backport/backport-4472-to-3.3
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 2854ad26d81e4788e2b7908c86e5eea4afe67e3e
# Push it to GitHub
git push --set-upstream origin backport/backport-4472-to-3.3
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-3.3Then, create a pull request where the |
Description
The tests
testBM25WithOpenAIWithImageandtestBM25WithOpenAIWithConversationAndImageare failing with error:This seems to be a known issue with OpenAI's backend failing intermittently with wikimedia, facebook graph api, etc. Example reference here
https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=800)Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
--signoff.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.