← Back to Pull requests

test(tools): the shell-script tests run Git Bash on Windows, and the Keycloak ones skip there #662

Open
unknown opened this pull request with 239 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 17, 2026 05:27 UTC
Author

Module


tools/scripts/tests

Task


Finishes the Windows support that #583 started for precheck.sh: pytest tools/scripts/tests now runs on a Windows laptop (Git Bash), not only CI.

What was wrong


On Windows, subprocess.run(["bash", ...]) finds C:\Windows\System32\bash.exe (the WSL launcher) before Git Bash, because CreateProcess searches the system folder first. That bash cannot open a Windows path, so every test that starts a script through it failed with exit code 127. 11 tests failed on a Windows 11 laptop with Git for Windows: 5 in test_precheck.py (the two "everything passing" cases, "without a venv", and two of the three tests #658 added) and the 6 in test_keycloak_realm.py. The third test from #658 (check_commits fails when git log fails) passed only by accident: the wrong bash also exits non-zero.

What changes


  • test_precheck.py and test_keycloak_realm.py start BASH = shutil.which("bash") or "bash" instead of the bare name: the bash on PATH, by its full path. On Linux and macOS that is /usr/bin/bash or similar, as before, so CI behaves exactly as before. All 4 calls in test_precheck.py (including the 3 added by #658) use it.

  • The Keycloak tests skip on Windows, like test_monitor and test_db_restore already do: keycloak-realm.sh runs on the Linux API host and needs python3, which on Windows is the Microsoft Store shortcut.
  • No script and no production code changes.

    Checked (Windows 11, Git Bash, Python 3.12)


  • pytest tools/scripts/tests on main: 11 failed, 216 passed, 27 skipped.

  • With this change: 221 passed, 33 skipped, 0 failed (the 6 Keycloak tests now skip).

  • tools/scripts/precheck.sh: ok.

  • Not run on Linux from here; CI's governance job runs these tests there.
  • Time spent


    Time spent: 0.3h

    Contract change?


  • No
  • 🤖 Generated with Claude Code

    Diff: 239 lines (+179 / -60) across 2 files Reviewer: github-actions[bot] Review duration: 8m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.37) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 239 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.328
    Real PR Conversation Timeline
    1 comments
    "Review active on #662"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% reviewed
    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: 37.2% (MEDIUM) · Higher = larger blast radius
    37.2%
    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: 43.0% · Lower = rushed or shallow review
    43.0%
    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: 21.2% · Safe to merge
    21.2%