Skip to content

Add error test for validateRequestedFp16Component#217

Open
ysdede wants to merge 1 commit into
masterfrom
test-hub-fp16-missing-entirely-17034717363924255224
Open

Add error test for validateRequestedFp16Component#217
ysdede wants to merge 1 commit into
masterfrom
test-hub-fp16-missing-entirely-17034717363924255224

Conversation

@ysdede
Copy link
Copy Markdown
Owner

@ysdede ysdede commented May 28, 2026

🎯 What: Added a missing error test case for validateRequestedFp16Component in src/hub.js.

📊 Coverage: Specifically covers the condition where an FP16 file is missing and no FP32 fallback is found, which triggers the error message: [Hub] Missing ${component.name} model in ${repoId}: requested ${fp16Name}.

Result: Increased test coverage for model quantization resolution error handling and strictly validates the fallback error message.


PR created automatically by Jules for task 17034717363924255224 started by @ysdede

Summary by Sourcery

Tests:

  • Add a test ensuring an explicit error is thrown when the FP16 encoder model is absent and no FP32 fallback exists, and that no resolve requests are made in this preflight failure case.

@google-labs-jules

This comment has been minimized.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The error expectation regex is very tightly coupled to the exact phrasing (including trailing period and specific wording); consider relaxing it slightly (e.g., just matching the key parts like Missing encoder model and the file name) to make the test less brittle to minor wording changes.
  • Since this scenario specifically validates the encoder error path, you might clarify that in the test name (e.g., throws explicit error when encoder FP16 is missing and no FP32 fallback exists) to make the intent clearer when scanning the test suite.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The error expectation regex is very tightly coupled to the exact phrasing (including trailing period and specific wording); consider relaxing it slightly (e.g., just matching the key parts like `Missing encoder model` and the file name) to make the test less brittle to minor wording changes.
- Since this scenario specifically validates the encoder error path, you might clarify that in the test name (e.g., `throws explicit error when encoder FP16 is missing and no FP32 fallback exists`) to make the intent clearer when scanning the test suite.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@ysdede ysdede changed the title 🧪 [Testing Improvement] Add error test for validateRequestedFp16Component Add error test for validateRequestedFp16Component May 29, 2026
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