ci: run pytest in parallel, start it with lint, cache the C++ runtime #348

Manually merged
github merged 1 commit from github-bot/gh-348 into main 2026-11-26 11:31:12 +00:00 AGit
Owner

@⁠LooperSalty on GitHub · 2026-11-26 10:53 UTC · original
LooperSalty:ci/faster-tests → main · +30 −2 · 2 files · 2 commits · merged 2026-11-26 11:12 UTC

Cuts the time of the tests workflow on pull requests to main.

Measured before (pytest job, two green runs of today)

Step Time
Runtime C++ (cmake) 55–58 s
Rust (bridge to TomBox) 59–69 s
pytest 58–75 s
Waiting for lint first (needs: lint) ~15–30 s (job plus runner start)

Changes

  1. pytest in parallel: python -m pytest -n auto with pytest-xdist==3.6.1 (added to requirements-dev.txt). Measured locally on 1,421 tests: 61 s serial, 21 s with -n 4, and 15 s with ANYXBOXX_REQUIRE_RUNTIME=1 ANYXBOXX_GPU=warp -n 4. Same results in all three runs, and the README test-count check still passes (each xdist worker collects the full suite).
  2. No needs: lint: the three jobs start together. lint is still a required check and still blocks the merge when it fails.
  3. C++ runtime cache: runtime/build (about 9 MB, without runtime/build/tombox), keyed by hashFiles('runtime/**') and the runner image version (MSVC). It is restored on every run and saved from main only, like the Rust cache. The build only reads runtime/ (checked in runtime/CMakeLists.txt), so it is skipped whenever runtime/ is unchanged.

Expected: about 1.5–2.5 min less per run (more when runtime/ is unchanged). The check names (lint, politique VIctory, pytest) are unchanged, so branch protection needs no edit.

Test plan

  • YAML parses, and the job and step names are unchanged where protection reads them
  • Full suite with -n 4 locally, serial and CI env: all passed
  • This PR's own CI: green, with pytest faster than ~1 min
  • After merge, the next run on main saves runtime-cpp-*, and the PR after that restores it (Runtime C++ skipped)

A matching PR for rust/full follows. There, the Rust cache is never saved (no push trigger on rust/full, save-if main only), so every PR recompiles the whole workspace.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox

**@⁠LooperSalty** on GitHub · 2026-11-26 10:53 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/348) `LooperSalty:ci/faster-tests` → `main` · +30 −2 · 2 files · 2 commits · merged 2026-11-26 11:12 UTC Cuts the time of the `tests` workflow on pull requests to `main`. ## Measured before (pytest job, two green runs of today) | Step | Time | | --- | --- | | Runtime C++ (cmake) | 55–58 s | | Rust (bridge to TomBox) | 59–69 s | | pytest | 58–75 s | | Waiting for `lint` first (`needs: lint`) | ~15–30 s (job plus runner start) | ## Changes 1. **pytest in parallel**: `python -m pytest -n auto` with `pytest-xdist==3.6.1` (added to `requirements-dev.txt`). Measured locally on 1,421 tests: 61 s serial, 21 s with `-n 4`, and 15 s with `ANYXBOXX_REQUIRE_RUNTIME=1 ANYXBOXX_GPU=warp -n 4`. Same results in all three runs, and the README test-count check still passes (each xdist worker collects the full suite). 2. **No `needs: lint`**: the three jobs start together. `lint` is still a required check and still blocks the merge when it fails. 3. **C++ runtime cache**: `runtime/build` (about 9 MB, without `runtime/build/tombox`), keyed by `hashFiles('runtime/**')` and the runner image version (MSVC). It is restored on every run and saved from `main` only, like the Rust cache. The build only reads `runtime/` (checked in `runtime/CMakeLists.txt`), so it is skipped whenever `runtime/` is unchanged. Expected: about 1.5–2.5 min less per run (more when `runtime/` is unchanged). The check names (`lint`, `politique VIctory`, `pytest`) are unchanged, so branch protection needs no edit. ## Test plan - [x] YAML parses, and the job and step names are unchanged where protection reads them - [x] Full suite with `-n 4` locally, serial and CI env: all passed - [ ] This PR's own CI: green, with pytest faster than ~1 min - [ ] After merge, the next run on `main` saves `runtime-cpp-*`, and the PR after that restores it (Runtime C++ skipped) A matching PR for `rust/full` follows. There, the Rust cache is never saved (no push trigger on `rust/full`, `save-if` main only), so every PR recompiles the whole workspace. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
- pytest -n auto (pytest-xdist): measured locally on 1,421 tests, 61 s
  serial against 15 s with -n 4 (ANYXBOXX_REQUIRE_RUNTIME=1, WARP), same
  results.
- pytest no longer waits for lint: both are still required checks.
- The C++ runtime build (about 1 min, 9 MB) is cached by the hash of
  runtime/ and the runner image, read by every pull request, written from
  main only; it only compiles when runtime/ changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:03:26 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 10:53 UTC · original · edited 2026-11-26 10:54 UTC

Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T10:54:49.542125Z 9f583fc PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review" or "@⁠codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 10:53 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/348#issuecomment-7189981320) · edited 2026-11-26 10:54 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"9f583fcfad1b06cfe78cb18093f844aa599449dd","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-26T10:54:49.542125Z">2026-11-26T10:54:49.542125Z</relative-time> | `9f583fc` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review" or "@⁠codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
github manually merged commit 352a9d398d into main 2026-11-26 11:31:12 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.