fix(cargo-gamma): support standalone toolchains in environment tests - #194
Conversation
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
There was a problem hiding this comment.
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 Report✅ All modified and coverable lines are covered by tests. ❌ 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🤖 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, andjust 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.