🧪 Add tests for LLMModelType migration logic#32
Conversation
Co-authored-by: Gunnarguy <110250624+Gunnarguy@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Reviewer's GuideAdds a new XCTestCase for LLMModelType to cover deprecated raw values and migration behavior from deprecated, current, and unknown string identifiers. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The test cases repeat the same raw values across multiple methods; consider extracting arrays of deprecated/current/unknown values and iterating over them to reduce duplication and make future updates to the set of model types easier to maintain.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The test cases repeat the same raw values across multiple methods; consider extracting arrays of deprecated/current/unknown values and iterating over them to reduce duplication and make future updates to the set of model types easier to maintain.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Pull request overview
Adds a new XCTestCase to cover the LLMModelType migration helpers used to map deprecated/unknown persisted model keys to supported defaults in the OpenIntelligence engine module.
Changes:
- Introduces
LLMModelTypeTestsverifyingisDeprecatedRawValue(_:)behavior for deprecated vs current vs junk keys. - Adds tests validating
migrate(from:)maps deprecated/unknown keys to.appleIntelligenceand preserves current keys.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import XCTest | ||
| @testable import OpenIntelligenceEngine | ||
|
|
||
| final class LLMModelTypeTests: XCTestCase { |
| XCTAssertFalse(LLMModelType.isDeprecatedRawValue("apple_intelligence")) | ||
| XCTAssertFalse(LLMModelType.isDeprecatedRawValue("on_device_analysis")) |
| XCTAssertEqual(LLMModelType.migrate(from: "apple_intelligence"), .appleIntelligence) | ||
| XCTAssertEqual(LLMModelType.migrate(from: "on_device_analysis"), .onDeviceAnalysis) |
🎯 What: The testing gap for
LLMModelTypemigration logic was addressed by adding a dedicatedXCTestCase.📊 Coverage: The tests now cover
.isDeprecatedRawValuereturningtruefor expected values andfalsefor others. Additionally, they verify themigrate(from:)fallback behavior for deprecated variables to default to.appleIntelligenceand unknown values, as well as preserving correct assignments.✨ Result: Improved test coverage around deprecated model migration handling, ensuring it functions reliably.
PR created automatically by Jules for task 71308968779673966 started by @Gunnarguy
Summary by Sourcery
Add unit tests covering LLMModelType deprecation detection and migration behavior.
Tests: