Skip to content

CI: run scripts/test_*.py before the Rust build (#1000) - #1019

Open
ChalanaGimhanaX wants to merge 1 commit into
xcl-dev:mainfrom
ChalanaGimhanaX:ci/run-script-tests
Open

ChalanaGimhanaX wants to merge 1 commit into
xcl-dev:mainfrom
ChalanaGimhanaX:ci/run-script-tests

Conversation

@ChalanaGimhanaX

Copy link
Copy Markdown
Contributor

Adds a Script tests step to .github/workflows/ci.yml right after checkout so scripts/test_pr_check.py (and any future scripts/test_*.py files) run on every push and PR before the Rust toolchain install and build. Previously nothing in CI ran scripts/test_pr_check.py, and PR checks (pull_request_target) runs main's copy of scripts/pr_check.py, so a PR that broke the checker still passed both workflows. Fixes #1000.

What is in it

  • .github/workflows/ci.yml: add a Script tests step (python -B -m unittest discover -s scripts -p 'test_*.py' -v) immediately after actions/checkout@v4.

CI time

  • Adds ~1 s to the Windows CI job (runs in 0.002 s locally; fails fast before rustup and cargo).

Tested

  • Hardware: Windows 11 Pro (build 26300), AMD Ryzen 7 250, AMD Radeon 780M Graphics (driver 32.0.21030.11004), DXC 1.8.2502.11, Python 3.12.10, rustc 1.100.0 (0ef1bc386 2026-11-09) (debug)
  • python -B -m unittest discover -s scripts -p 'test_*.py' -v: 5 ran, 5 passed, 0 failed (0.002 s, exit 0)
  • Negative control (temp copy outside the repo with runtime() returning False): 5 ran, 1 failed, exit 1
  • XCL_ADAPTER=radeon .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 727 passed, 0 failed, 41 ignored (0 SKIPPED GPU tests)

Not tested

  • Retail game smoke run (scripts/smoke.ps1, no crates/xcl/src runtime files changed; no retail game files on this machine)
  • NVIDIA GeForce RTX 5060 Laptop GPU (XCL_ADAPTER=nvidia) and d3d12SDKLayers.dll

AI use

  • Antigravity (Gemini 4 Neon): inspected .github/workflows/ci.yml, added the CI step, ran the script tests and full GPU test suite, and wrote this description.

.github/workflows/ci.yml previously ran only scripts/test.ps1, so
scripts/test_pr_check.py never executed in CI (and PR checks runs main's
copy of scripts/pr_check.py via pull_request_target).

Add a Script tests step right after checkout running
`python -B -m unittest discover -s scripts -p 'test_*.py' -v` so broken
script tests fail in ~1 second before installing Rust or building the
workspace, and any future scripts/test_*.py files are picked up
automatically.

Fixes xcl-dev#1000

Assisted-by: Antigravity (Gemini 4 Neon)
@fromthemoonx

Copy link
Copy Markdown

Local run of the new step on Windows, the OS the CI job uses.

Tested (Windows 11 Pro 26H2 build 26300, Python 3.12, Git Bash and Windows PowerShell 5.1)

  • Head 94fa47bc61bb7b3247970d53a421491accae77ed merged onto current main 47efa2e (no conflict). The step's exact command, python -B -m unittest discover -s scripts -p 'test_*.py' -v, from the repository root: 9 tests, OK, exit 0. It found scripts/test_pr_check.py, which now includes the PR checks: runtime files outside crates/xcl/src skip the regression run #964 and PR checks: an untouched PR template passes the Tested and AI use checks #965 tests.
  • The same command through PowerShell (5.1 here; the step uses pwsh, which isn't installed here): 9 tests, OK, $LASTEXITCODE 0. The single-quoted glob reaches Python as a pattern.
  • It catches a broken checker: with runtime() in scripts/pr_check.py changed to always return False (local change only), the command reports FAILED (failures=1) and exits 1, so the step would fail the job.
  • The step runs before the Rust toolchain step, so a broken checker fails within seconds.

Not tested

AI use

  • Claude Code (Claude Opus 5.5) ran the commands above and wrote this report.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

Thanks!

@RavenCurseBurg

RavenCurseBurg commented Nov 26, 2026 •

Copy link
Copy Markdown

I ran the proposed discovery command in PowerShell 7.6.9 on Windows 11. The exact #1019 head 94fa47bc61bb7b3247970d53a421491accae77ed passed its five Python tests. I then combined it with #2575 at 0723b118cbafabb3c2200b0c9680e2a874335310. Discovery runs before the Rust install; #2575's required-DXC command runs after the build.

With DXC 1.9.2609.5 available, discovery passed 32 tests and python -B scripts/test_dxil_semantics.py --require-dxc passed seven. With XCL_DXC_DIR pointing to a missing directory, discovery passed 25 tests but skipped three inspector tests that need no compiler. The required command failed before running any tests.

Independently applicable test-only fix moves those three tests out of the compiler-dependent class. I repeated both commands: with the missing directory, discovery now passes 28 tests (one class skipped), and the required command runs the three independent tests and still exits 1. With DXC present the counts remain 32 and seven, both exit 0. Core i7-13700, Python 3.14.3. Local workflow commands only; no hosted Actions run, Rust build or GPU execution. OpenAI Codex (GPT-6) prepared the change and ran the checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

off-goal Does not bear on the current goal (world loading); waits until it is reached

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: the PR checker's own tests (scripts/test_pr_check.py) never run

5 participants