test: add Mac Xcode locator coverage#429
Conversation
Performance Report (macOS)
Legend
|
Performance Report (Windows) ✅
Legend
|
Test Coverage Report (Windows)
Coverage increased! Great work! |
Performance Report (Linux) ➖
Legend
|
Test Coverage Report (Linux)
Coverage increased! Great work! |
There was a problem hiding this comment.
Pull request overview
Adds deterministic unit test coverage for the pet-mac-xcode locator and tightens its identification behavior so it reports/recognizes Xcode Python installations more precisely within PET’s locator ecosystem.
Changes:
- Fix
MacXCode::supported_categories()to returnPythonEnvironmentKind::MacXCode. - Add
is_xcode_python_path()helper to narrowly classify Xcode Python executable paths (usr/bin and framework layouts). - Add focused unit tests for path matching, locator metadata, and non-macOS rejection behavior.
Show a summary per file
| File | Description |
|---|---|
| crates/pet-mac-xcode/src/lib.rs | Corrects reported supported category, tightens Xcode path detection via a helper, and adds deterministic unit tests to improve coverage. |
Copilot's findings
Comments suppressed due to low confidence (1)
crates/pet-mac-xcode/src/lib.rs:267
- In the framework layout branch, the final component check also only enforces
starts_with("python"). To keep identification consistent with the rest of the codebase and avoid false positives, consider validating the executable name with the same criteria used elsewhere (e.g.is_python_executable_name).
&& framework_parts.next() == Some("bin")
&& framework_parts
.next()
.is_some_and(|executable| executable.starts_with("python"))
&& framework_parts.next().is_none()
- Files reviewed: 1/1 changed files
- Comments generated: 2
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds targeted unit tests and tighter path classification for the macOS Xcode Python locator, while correcting reported supported environment categories.
Changes:
- Fix
MacXCode::supported_categories()to returnMacXCodeinstead ofMacCommandLineTools. - Replace broad string checks with a dedicated
is_xcode_python_path()matcher for Xcode.applayouts. - Add deterministic tests for Xcode path acceptance/rejection and non-macOS behavior.
Show a summary per file
| File | Description |
|---|---|
| crates/pet-mac-xcode/src/lib.rs | Corrects locator category reporting, introduces strict Xcode python path matcher, and adds focused unit tests. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 2
Adds focused direct coverage for the Mac Xcode locator while continuing the #389 coverage work.
Validation:
Refs #389