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

Open
github-bot wants to merge 1 commit from github-bot/gh-1019 into main AGit
Owner

@⁠ChalanaGimhanaX on GitHub · 2026-11-24 10:25 UTC · original
ChalanaGimhanaX:ci/run-script-tests → main · +4 −0 · 1 files · 1 commits · open

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.
**@⁠ChalanaGimhanaX** on GitHub · 2026-11-24 10:25 UTC · [original](https://github.com/xcl-dev/xcl/pull/1019) `ChalanaGimhanaX:ci/run-script-tests` → `main` · +4 −0 · 1 files · 1 commits · open 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 #1000

Assisted-by: Antigravity (Gemini 4 Neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:40:46 +00:00
Author
Owner

@⁠fromthemoonx on GitHub · 2026-11-24 11:36 UTC · original

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 #964 and #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

  • The workflow on GitHub itself (Actions isn't run here), and pwsh 7 specifically.
  • For the maintainer: #597 adds a separate scripts.yml workflow for the same tests (with a paths: filter). #1000 was closed as its duplicate, and #597 currently conflicts with main in scripts/test_pr_check.py. Probably only one of the two is wanted.

AI use

  • Claude Code (Claude Opus 5.5) ran the commands above and wrote this report.
**@⁠fromthemoonx** on GitHub · 2026-11-24 11:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/1019#issuecomment-7130315978) 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 #964 and #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** - The workflow on GitHub itself (Actions isn't run here), and `pwsh` 7 specifically. - For the maintainer: #597 adds a separate `scripts.yml` workflow for the same tests (with a `paths:` filter). #1000 was closed as its duplicate, and #597 currently conflicts with `main` in `scripts/test_pr_check.py`. Probably only one of the two is wanted. **AI use** - Claude Code (Claude Opus 5.5) ran the commands above and wrote this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 09:17 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 09:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/1019#issuecomment-7158124242) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠RavenCurseBurg on GitHub · 2026-11-26 00:36 UTC · original · edited 2026-11-26 00:43 UTC

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.

**@⁠RavenCurseBurg** on GitHub · 2026-11-26 00:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/1019#issuecomment-7178923586) · edited 2026-11-26 00:43 UTC 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](https://github.com/RavenCurseBurg/xcl/commit/01a4075f8cc36e5370d0c880a2061bfa263c75cb) 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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1019/head:github-bot/gh-1019'
git switch 'github-bot/gh-1019'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1019'
git switch 'github-bot/gh-1019'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1019'
git switch 'github-bot/gh-1019'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1019'
git switch 'main'
git merge --squash 'github-bot/gh-1019'
git switch 'main'
git merge --ff-only 'github-bot/gh-1019'
git switch 'main'
git merge 'github-bot/gh-1019'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.