← Back to Pull requests

Load pytest Git config plugin from a root conftest.py #10399

Closed
unknown closed this pull request without merging on Dec 01, 2026 18:22 UTC
View on GitHub
unknown unknown commented on Dec 01, 2026 17:34 UTC
Author

Motivation

Since #10294, PyTorch wheel test jobs fail at "Run PyTorch smoketests" with ImportError: Error importing plugin "_therock_utils.pytest_git_config_plugin" (example run). pytest < 8.4 imports -p plugins before applying pythonpath, and the job installs pytest 7.3.2 from PyTorch's requirements-ci.txt.

ISSUE ID: #10294

Technical Details

  • Drop the -p entry from pyproject.toml addopts.

  • Add a root conftest.py that registers the plugin in pytest_configure, after pythonpath is applied. It does this only when TheRock's pyproject.toml is the active config, so runs under another config such as -c /dev/null don't fail on the import.
  • Test Plan

  • New tests: the plugin is registered, addopts doesn't load it with -p in either form, and collection succeeds under an external config.

  • Plugin tests on pytest 7.3.2, 9.0.3, and 9.2.0, run from the repo root, a subdirectory, and /tmp.

  • Smoke tests on pytest 7.3.2: python -m pytest <abs>/external-builds/pytorch/smoke-tests.

  • Full unit suite: python -m pytest -n 4, compared against main.

  • PyTorch wheel test run on this branch (gfx94X-dcgpu, torch 2.16.0a0+rocm10.3.0a20261201): https://github.com/ROCm/TheRock/actions/runs/46709995631
  • Test Result

  • Plugin tests pass on all three pytest versions. Reverting either fix makes the matching new test fail.

  • Smoke tests on 7.3.2 now get past plugin loading. A run with CPU-only torch can't validate the GPU smoke tests themselves.

  • The full unit suite has the same 50 failures as main, all from this host's environment, so this change adds none.

  • PyTorch wheel run on the head commit: in progress. On the first commit, "Run PyTorch smoketests" passed (run).
  • Submission Checklist

  • Look over the contributing guidelines at https://github.com/ROCm/TheRock/blob/main/CONTRIBUTING.md.
  • Drafted with an AI coding assistant.

    Diff: 255 lines (+191 / -64) across 3 files Reviewer: ScottTodd Review duration: 48m
    All Vouch review confidence checks passed
    Residual risk 0.25 = Change Risk (0.62) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.62 · 255 lines diff across 3 files
    0.62
    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.332
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.062
    Real PR Conversation Timeline
    1 comments
    "Review active on #10399"
    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: 62.3% (MEDIUM) · Higher = larger blast radius
    62.3%
    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.6% · Safe to merge
    24.6%
    Repository