Skip to content

test: add Linux global Python coverage#428

Open
karthiknadig wants to merge 2 commits intomainfrom
test/issue-389-linux-global-python
Open

test: add Linux global Python coverage#428
karthiknadig wants to merge 2 commits intomainfrom
test/issue-389-linux-global-python

Conversation

@karthiknadig
Copy link
Copy Markdown
Member

Summary:

  • Add focused unit tests for Linux global Python environment construction, architecture mapping, symlink handling, and early rejection paths.
  • Reject non-global paths before hydrating the Linux global cache to avoid unnecessary global-bin scans.

Validation:

  • cargo fmt --all
  • wsl bash -lc 'cd /mnt/c/GIT/projects/python-environment-tools && cargo test -p pet-linux-global-python'
  • 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 22:41
@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 0ms 1ms 1ms -1ms -100.0%
Full Refresh 53ms 210ms 77ms -24ms -30.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 74.9%
Base Branch Coverage 74.6%
Delta .3% ✅

Coverage increased! Great work!

@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 59ms 560ms 76ms -17ms
Full Refresh 129ms 27871ms 143ms -14ms

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.72%
Base Branch Coverage 71.26%
Delta 0.46% ✅

Coverage increased! Great work!

@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 155ms 407ms 217ms -62ms -28.6%

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)

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

This PR increases test coverage for the pet-linux-global-python locator and adjusts try_from() to avoid hydrating (scanning) the Linux global-python cache when the candidate executable is clearly not a global install path.

Changes:

  • Move find_cached(None) in LinuxGlobalPython::try_from() to occur only after the global-path guard passes.
  • Add focused unit tests covering Linux global environment construction, architecture mapping, symlink handling, and early rejection behavior.
  • Add tempfile as a dev-dependency for the new tests.
Show a summary per file
File Description
crates/pet-linux-global-python/src/lib.rs Reorders cache hydration in try_from() and adds unit tests for get_python_in_bin() and try_from() early-reject paths.
crates/pet-linux-global-python/Cargo.toml Adds tempfile under [dev-dependencies] to support new tests.
Cargo.lock Updates lockfile to reflect the new dev-dependency linkage from pet-linux-global-python.

Copilot's findings

  • Files reviewed: 2/3 changed files
  • Comments generated: 0

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

Improves pet-linux-global-python confidence and performance by adding targeted unit tests around Linux global environment construction and by avoiding unnecessary global-bin cache hydration when the candidate executable is clearly not in a supported global location.

Changes:

  • Delay find_cached(None) until after the global-path guard in LinuxGlobalPython::try_from() to avoid scanning /bin//usr/bin//usr/local/bin for non-global candidates.
  • Add focused unit tests for get_python_in_bin() (arch mapping, symlink handling, and negative cases) and for early-return paths in try_from().
  • Add tempfile as a dev-dependency for the new tests and update lockfile.
Show a summary per file
File Description
crates/pet-linux-global-python/src/lib.rs Moves cache hydration behind path rejection and adds unit tests covering env construction + symlink and rejection behaviors.
crates/pet-linux-global-python/Cargo.toml Adds tempfile under dev-dependencies to support new unit tests.
Cargo.lock Records tempfile as a dependency for pet-linux-global-python.

Copilot's findings

  • Files reviewed: 2/3 changed files
  • Comments generated: 0 new

@karthiknadig karthiknadig marked this pull request as ready for review April 15, 2026 23:14
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