[PR #2704] [MERGED] test: run the full content-root tests only where they matter #4553

Closed
opened 2026-11-03 04:18:00 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2704
Author: @ludovic111
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: test/mod-content-shared-assets


📝 Commits (1)

  • 8075127 test: run the full content-root tests only where they matter

📊 Changes

5 files changed (+33 additions, -0 deletions)

View changed files

📝 .github/workflows/ci.yml (+3 -0)
📝 AGENTS.md (+1 -0)
📝 crates/horizon-client/src/mod_content_tests.rs (+5 -0)
📝 tests/test_pr_ready.py (+13 -0)
📝 tools/pr_ready.py (+11 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Why

cargo test -p horizon-client --lib is the main test loop for the game's lib. On prepared data, 16 mod_content tests took 281 s of it (Mac mini under load), against 72 s for the other 1121 tests. Five of them load the full content root (assets, block facts, behaviours, items) one or more times: 69, 57, 47, 31 and 22 s each.

What

  • The 5 full-content-root tests are #[ignore = "full content root: CI and pr_ready run it"]. The other 11 mod_content tests still run by default.
  • tools/pr_ready.py adds a "content root tests" step: cargo test --locked -p horizon-client --features horizon-client/mods --lib mod_content::tests:: -- --ignored. It runs only when the diff touches what those tests load: mod_content*, the client's assets.rs, blocks.rs and items.rs, horizon-items, horizon-mods, horizon-assets, or a workspace-wide file. Otherwise it reports "skip: content root untouched". There is a unit test for both cases.
  • CI has no prepared vanilla data, so in CI these tests return at once (as before): their real coverage is pr_ready on diffs that touch what they load, plus the parity harnesses.
  • CI's verify job still runs them with --ignored and the same features as its main test line, so it reuses that build.
  • One line in AGENTS.md ("Build and test fast") tells agents how to run them.

Measured (Mac mini, -j 8, load ~30-40)

  • cargo test -p horizon-client --features horizon-client/mods --lib mod_content::tests:: (default): 11 passed, 5 ignored, run 15.1 s. Before, the 16 tests took 72-281 s depending on load.
  • ... -- --ignored: 5 passed in 66.3 s (these now run only when relevant).

Self-check

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 6af60956e, 11 min 24 s)

Check Result
Scope ⚠️ 5 files, +33 −0; mixes CI, game
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 328 passed (39 s)
rustfmt ✅ (5 s)
clippy ✅ (2 min 8 s)
tests: horizon-client ✅ 1282 passed (3 min 6 s)
doc tests ✅ 0 passed (15 s)
content root tests ✅ 5 passed (1 min 47 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (2 s)
launcher clippy ✅ (1 min 18 s)
launcher tests ✅ 193 passed (2 min 1 s)
Parity ➖ 1 affected, to run in CI (--quick): lan_integration
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2704 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `test/mod-content-shared-assets` --- ### 📝 Commits (1) - [`8075127`](https://github.com/horizon-rust/horizon/commit/80751276f33f23023956e959d70b31936f6e3e10) test: run the full content-root tests only where they matter ### 📊 Changes **5 files changed** (+33 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+3 -0) 📝 `AGENTS.md` (+1 -0) 📝 `crates/horizon-client/src/mod_content_tests.rs` (+5 -0) 📝 `tests/test_pr_ready.py` (+13 -0) 📝 `tools/pr_ready.py` (+11 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## Why `cargo test -p horizon-client --lib` is the main test loop for the game's lib. On prepared data, 16 `mod_content` tests took 281 s of it (Mac mini under load), against 72 s for the other 1121 tests. Five of them load the full content root (assets, block facts, behaviours, items) one or more times: 69, 57, 47, 31 and 22 s each. ## What - The 5 full-content-root tests are `#[ignore = "full content root: CI and pr_ready run it"]`. The other 11 `mod_content` tests still run by default. - `tools/pr_ready.py` adds a "content root tests" step: `cargo test --locked -p horizon-client --features horizon-client/mods --lib mod_content::tests:: -- --ignored`. It runs only when the diff touches what those tests load: `mod_content*`, the client's `assets.rs`, `blocks.rs` and `items.rs`, `horizon-items`, `horizon-mods`, `horizon-assets`, or a workspace-wide file. Otherwise it reports "skip: content root untouched". There is a unit test for both cases. - CI has no prepared vanilla data, so in CI these tests return at once (as before): their real coverage is pr_ready on diffs that touch what they load, plus the parity harnesses. - CI's verify job still runs them with `--ignored` and the same features as its main test line, so it reuses that build. - One line in AGENTS.md ("Build and test fast") tells agents how to run them. ## Measured (Mac mini, -j 8, load ~30-40) - `cargo test -p horizon-client --features horizon-client/mods --lib mod_content::tests::` (default): 11 passed, 5 ignored, run 15.1 s. Before, the 16 tests took 72-281 s depending on load. - `... -- --ignored`: 5 passed in 66.3 s (these now run only when relevant). ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 6af60956e, 11 min 24 s) | Check | Result | | --- | --- | | Scope | ⚠️ 5 files, +33 −0; mixes CI, game | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 328 passed (39 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (2 min 8 s) | | tests: horizon-client | ✅ 1282 passed (3 min 6 s) | | doc tests | ✅ 0 passed (15 s) | | content root tests | ✅ 5 passed (1 min 47 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (2 s) | | launcher clippy | ✅ (1 min 18 s) | | launcher tests | ✅ 193 passed (2 min 1 s) | | Parity | ➖ 1 affected, to run in CI (--quick): lan_integration | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:18:00 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4553
No description provided.