Skip to content

test(cargo-gamma): keep runtime fixtures offline - #171

Merged
martin-kolinek merged 1 commit into
mainfrom
network-isolation-test-fix
Sep 9, 2026
Merged

test(cargo-gamma): keep runtime fixtures offline#171
martin-kolinek merged 1 commit into
mainfrom
network-isolation-test-fix

Conversation

@martin-kolinek

Copy link
Copy Markdown
Collaborator

Problem

Build 40731154 introduced two cargo-gamma CLI tests that create temporary workspaces pointing at the repository's real cargo-gamma-rt manifest. Before cargo-gamma can redirect that dependency, cargo metadata resolves its workspace-inherited loom dependency and contacts index.crates.io. The official pipeline enforces network isolation, so both tests fail; the missing clippy SARIF and Rust evidence directories are downstream symptoms.

Fix

Use a dependency-free local cargo-gamma-rt stub as the fixture's pre-redirect dependency. The stub declares embedding but deliberately omits gamma_rt::embedded, preserving the test's proof: it succeeds only if cargo-gamma redirects to the real vendored runtime and retains the feature.

Verification

  • Both affected tests pass on Windows with CARGO_NET_OFFLINE=true
  • Both affected tests pass on Linux with CARGO_NET_OFFLINE=true
  • Full cargo-gamma-lib nextest suite passes (1,948 tests)

Use a dependency-free local runtime stub for feature-preservation tests so metadata resolution does not contact crates.io under network isolation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 8, 2026 17:27

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.

🟢 Approval recommended

The changes are localized to test fixtures and directly address the stated offline-CI failure mode without introducing apparent behavioral risk outside the affected tests.

Pull request overview

This PR fixes cargo-gamma CLI integration tests failing under network-isolated CI by ensuring the runtime dependency used in test fixtures does not trigger registry access before cargo-gamma performs its dependency redirection.

Changes:

  • Added a local, dependency-free cargo-gamma-rt “runtime-stub” fixture generator for CLI tests.
  • Updated the two affected tests to depend on the local stub runtime instead of the repository’s real runtime crate path, preventing cargo metadata from touching crates.io before redirection.
File summaries
File Description
crates/cargo-gamma-lib/tests/cli.rs Introduces a local runtime stub and rewires two CLI tests to use it, keeping fixtures offline until cargo-gamma redirects dependencies.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

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

@codecov-commenter

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

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.1%. Comparing base (26e5c60) to head (f12852a).
⚠️ Report is 5 commits behind head on main.

❌ Your project status has failed because the head coverage (93.1%) 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    #171      +/-   ##
========================================
- Coverage   97.5%   93.1%    -4.5%     
========================================
  Files        300     154     -146     
  Lines      68538   44178   -24360     
========================================
- Hits       66876   41155   -25721     
- Misses      1662    3023    +1361     
Flag Coverage Δ
linux 93.2% <ø> (-4.4%) ⬇️
linux-arm 93.2% <ø> (-4.4%) ⬇️
scheduled ?
windows 93.8% <ø> (-3.9%) ⬇️

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.

@martin-kolinek
martin-kolinek enabled auto-merge (squash) September 8, 2026 17:59
@martin-kolinek
martin-kolinek merged commit 83e5402 into main Sep 9, 2026
30 checks passed
@martin-kolinek
martin-kolinek deleted the network-isolation-test-fix branch September 9, 2026 07:30
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