← Back to Pull requests

test: isolate tests from MBX_LINKER, RUSTC and the host mbx config #864

Closed
unknown closed this pull request without merging on Oct 28, 2026 18:22 UTC
View on GitHub
unknown unknown commented on Oct 28, 2026 10:43 UTC
Author

Several tests depended on the developer's environment or mbx config. They failed, or passed for the wrong reason, when common variables were set or the host config selected a managed linker:

  • four managed_linker tests (three profile-policy tests and the universal macOS system-linker test) failed with MBX_LINKER set, because it overrides per-target selection;

  • a_compiler_named_in_cargo_configuration_is_left_to_cargo failed with RUSTC or CARGO_BUILD_RUSTC set, or with build.rustc in the host's Cargo config (cargo_config2 reads them);

  • the storage_placement fixtures inherited the user's mbx config, so a managed linker in it was downloaded into every fresh test cache. Run in parallel, this hit GitHub's API rate limit;

  • with that config, rejects_tools_symlink_before_initializing_storage still passed when check_cache checked only the cache root, so it stopped guarding the rule from #428.
  • Now:

  • managed_linker's resolve delegates to a private resolve_with_environment, and the tests pass a controlled value. This is a small refactor of non-test code with no change in behavior.

  • The cargo-config test runs itself again in a child process with RUSTC and CARGO_BUILD_RUSTC removed and an empty CARGO_HOME, and requires exactly one test to run there, so a filter that matches nothing cannot pass silently.

  • The storage fixtures hide the host config and select the system linker. The symlink test asserts the cache-specific NFS rejection. With the #428 regression put back, it fails at that assertion.
  • Each affected test was run with the variables set and unset, and with a host-like mold config.

    Reported as jbellis/mr-boxington#43.

    AI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5-5; version: 2.1.306.

    🤖 Generated with Claude Code

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Bug Fixes
    Blank MBX_LINKER values are now treated as unset during linker selection.
    Tests
    Expanded checks for compiler configuration and storage placement in isolated environments, including validation of cache-related error output.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 286 lines (+214 / -72) across 3 files Reviewer: jbellis Review duration: 458m
    All Vouch review confidence checks passed
    Residual risk 0.25 = Change Risk (0.63) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.63 · 286 lines diff across 3 files
    0.63
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.339
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.063
    Real PR Conversation Timeline
    1 comments
    "Review active on #864"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 63.0% (MEDIUM) · Higher = larger blast radius
    63.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 24.9% · Safe to merge
    24.9%