Skip to content

fix(cargo-gamma): support standalone toolchains in environment tests - #194

Merged
martinhavelka (wukchung) merged 1 commit into
mainfrom
u/mhavelka/fix-gamma-runtime-env
Sep 21, 2026
Merged

martinhavelka (wukchung) merged 1 commit into
mainfrom
u/mhavelka/fix-gamma-runtime-env

Conversation

@wukchung

@wukchung martinhavelka (wukchung) commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

🤖 Fix runtime-environment tests on standalone Rust installations.

The shared fixture currently requires rustup-specific variables even when rustup is unavailable. Detect an active rustup toolchain when creating the fixture and condition only those assertions on its availability. Cargo and nextest assertions remain mandatory; production code is unchanged.

Validation

  • cargo nextest run --locked -p cargo-gamma-lib --all-features --test session -E 'test(launches_reproduce)' --no-fail-fast: 2 tests passed with rustup and 2 passed using standalone cargo/rustc with rustup and its environment variables removed.
  • cargo clippy --locked -p cargo-gamma-lib --all-features --test session -- -D warnings: passed.
  • just anvil-fmt anvil-readme-check anvil-spellcheck: passed.
  • git diff --check: passed.
  • just anvil-pr-fast: checks from formatting through audit passed.
  • just anvil-udeps, just anvil-semver-check, and just anvil-external-types: passed, completing the fast-tier checks.
  • just anvil-pr: stopped at its prerequisite check because the installed coverage tool is below the repository's required minimum.

Require rustup-specific environment variables only when an active rustup toolchain is available. Keep Cargo and nextest environment assertions unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f2464692-d45c-4470-a24e-ec24b46fe2b5
@wukchung
martinhavelka (wukchung) marked this pull request as ready for review September 21, 2026 10:10
Copilot AI lite review requested due to automatic review settings September 21, 2026 10:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

No unresolved review issues remain.

Review effort: Lite
Findings: None

What changed in this PR

Updates cargo-gamma environment tests to support standalone Rust toolchains while preserving rustup-specific checks when available.

Changes:

  • Detects active rustup toolchains.
  • Gates rustup assertions on availability.
  • Keeps Cargo and nextest assertions mandatory.
File Description
crates/​cargo-gamma-lib/​tests/​session.rs Adapts the environment fixture for rustup and standalone toolchains.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.8%. Comparing base (3da6be4) to head (5aec6e4).

❌ Your project status has failed because the head coverage (97.8%) is below the target coverage (100.0%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff            @@
##            main    #194      +/-   ##
========================================
- Coverage   98.2%   97.8%    -0.4%     
========================================
  Files        307     120     -187     
  Lines      83775   50482   -33293     
========================================
- Hits       82271   49421   -32850     
+ Misses      1504    1061     -443     
Flag Coverage Δ
linux 97.7% <ø> (-0.5%) ⬇️
linux-arm 97.7% <ø> (-0.5%) ⬇️
scheduled ?
windows 97.8% <ø> (-0.7%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wukchung
martinhavelka (wukchung) merged commit 5e228b8 into main Sep 21, 2026
29 checks passed
@wukchung
martinhavelka (wukchung) deleted the u/mhavelka/fix-gamma-runtime-env branch September 21, 2026 16:08
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.

5 participants