Skip to content

test: add Mac Xcode locator coverage#429

Merged
karthiknadig merged 3 commits intomainfrom
test/issue-389-mac-xcode
Apr 22, 2026
Merged

test: add Mac Xcode locator coverage#429
karthiknadig merged 3 commits intomainfrom
test/issue-389-mac-xcode

Conversation

@karthiknadig
Copy link
Copy Markdown
Member

Adds focused direct coverage for the Mac Xcode locator while continuing the #389 coverage work.

  • Adds deterministic tests for Xcode path matching, locator metadata, and non-macOS rejection.
  • Corrects MacXCode supported categories to report MacXCode.
  • Narrows Xcode path classification to Xcode*.app Python executables under the expected usr/bin or framework layouts.

Validation:

  • cargo fmt --all
  • wsl bash -lc 'cd /mnt/c/GIT/projects/python-environment-tools && cargo test -p pet-mac-xcode'
  • wsl bash -lc 'cd /mnt/c/GIT/projects/python-environment-tools && cargo clippy --all -- -D warnings'

Refs #389

@karthiknadig karthiknadig requested a review from Copilot April 15, 2026 23:13
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2026

Performance Report (macOS)

Metric PR (P50) PR (P95) Baseline (P50) Delta
Server Startup 77ms 510ms 76ms 1ms
Full Refresh 124ms 29630ms 143ms -19ms

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2026

Performance Report (Windows) ✅

Metric PR (P50) PR (P95) Baseline (P50) Delta Change
Server Startup 9ms 12ms 12ms -3ms -25%
Full Refresh 141ms 409ms 217ms -76ms -35%

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2026

Test Coverage Report (Windows)

Metric Value
Current Coverage 71.66%
Base Branch Coverage 71.26%
Delta 0.4% ✅

Coverage increased! Great work!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2026

Performance Report (Linux) ➖

Metric PR (P50) PR (P95) Baseline (P50) Delta Change
Server Startup 1ms 1ms 1ms 0ms 0%
Full Refresh 78ms 300ms 77ms 1ms 0%

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2026

Test Coverage Report (Linux)

Metric Value
Current Coverage 75.0%
Base Branch Coverage 74.6%
Delta .4% ✅

Coverage increased! Great work!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 return PythonEnvironmentKind::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

Comment thread crates/pet-mac-xcode/src/lib.rs Outdated
Comment thread crates/pet-mac-xcode/src/lib.rs
@karthiknadig karthiknadig requested a review from Copilot April 15, 2026 23:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 return MacXCode instead of MacCommandLineTools.
  • Replace broad string checks with a dedicated is_xcode_python_path() matcher for Xcode .app layouts.
  • 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

Comment thread crates/pet-mac-xcode/src/lib.rs Outdated
Comment thread crates/pet-mac-xcode/src/lib.rs
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new

@karthiknadig karthiknadig marked this pull request as ready for review April 22, 2026 21:45
@karthiknadig karthiknadig enabled auto-merge (squash) April 22, 2026 21:45
@karthiknadig karthiknadig merged commit d26de2e into main Apr 22, 2026
34 checks passed
@karthiknadig karthiknadig deleted the test/issue-389-mac-xcode branch April 22, 2026 22:26
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.

3 participants