Build and test
This page gets you to green tests on your machine and explains what CI runs on your pull request. It does not cover how to install Rust or a GPU driver.
Where things are in the repository
Section titled “Where things are in the repository”| Path | What is there |
|---|---|
crates/ |
The Rust crates, 206 of them. |
tools/ |
The snapshot update tool, fixtures, the vanilla oracle and benchmarks. |
xtask/ |
The check runner that CI and the local hooks use. |
assets/ |
The version file, reports from the game and local data packs. |
docs/ |
Specifications and design notes. The docs index lists them. |
docs-site/ |
This site. |
Run the tests
Section titled “Run the tests”cargo nextest run -p <crate> # one cratecargo nextest run --workspace # everything, before a pushcargo nextest run --profile full # plus the exhaustive sweepsThe runner is cargo-nextest. The repository pins the Rust toolchain in rust-toolchain.toml, and .config/nextest.toml pins the minimum version of the runner. Do not use cargo test, because it ignores .config/nextest.toml and most crates set doctest = false. A Claude Code hook in the repository rejects it.
The tests read the game’s data pack, so every profile first runs a setup script that installs the game’s client jar and unpacks its data pack into your cache directory. You do not download anything by hand, but the first run needs network access to Mojang.
A test name carries a tier prefix such as exhaustive:: or gpu::, and each profile selects tests by that prefix.
| Profile | What it runs |
|---|---|
default |
Everything except exhaustive::, gpu::, online:: and vanilla_server:: tests. |
ci |
The same filter as default, and it does not stop at the first failure. |
ci-hosted |
The filter of ci, for the test job on a GitHub-hosted machine. A test may run 5 minutes, and the whole run 30 minutes. |
full |
The default tier plus exhaustive:: and online::. The scheduled CI job and the worldgen-full job use it. |
gpu |
Only gpu:: tests. They need a machine with a Metal GPU. |
vanilla-server |
Only vanilla_server:: tests. They run through vanilla-server/run.sh. |
The default profile has a five-minute limit for the whole run and stops a test after four 15-second timeout periods. The full, gpu and vanilla-server profiles allow five 60-second periods per test; ci-hosted also allows 30 minutes for the whole run. Put expensive sweeps in exhaustive:: so ordinary runs skip them.
Run the xtask checks before a push
Section titled “Run the xtask checks before a push”CI and the local hooks call one runner, scripts/hooks/run-checks <trigger>. It builds xtask and runs the checks that belong to the trigger. You can run the same checks yourself before a push:
scripts/hooks/run-checks pushSee Repository checks for the trigger and check tables and the ECS lint driver’s scope and limits.
Client and experiment tools
Section titled “Client and experiment tools”See Automate the client for the MCP launcher and scripted client control.
Rewrite a stale blessed file with MCRS_BLESS
Section titled “Rewrite a stale blessed file with MCRS_BLESS”Some tests compare a generated file with a checked-in copy, called a blessed file. The baked entity assets and the generated shader layouts are checked this way. When the copy is stale, the test fails and its message names an environment variable. Run the test again with that variable set, and the test rewrites the copy:
MCRS_BLESS=1 cargo nextest run -p <crate>Read the diff before you commit it. If a blessed file changed and you cannot say why, the bug is in your change and the test was right to fail. The tests that read the variable are in crates/mcrs_minecraft_mesh/src/pack.rs, crates/mcrs_minecraft_render/src/shader_layout_emit.rs, crates/mcrs_minecraft_entity_model/tests/it/mob_assets.rs and crates/mcrs_minecraft_entity_animation/tests/it/mob_assets.rs.
What CI runs on your pull request
Section titled “What CI runs on your pull request”The workflow .github/workflows/checks.yml runs on every pull request to main and on every push to main. Its first job, changes, reads the file list of the pull request. If every file is documentation, agent instructions or a GitHub form, the Rust jobs do not run. Such files are under docs/, docs-site/, .agents/ or .claude/, or they are the issue forms, the pull request template, CODEOWNERS, .coderabbit.yaml, a Markdown file in the repository root or a LICENSE-* file.
The job issue-link runs on every pull request. It fails when the description of the pull request has no line Closes #N, Fixes #N, Resolves #N or Refs #N, unless the pull request has the label no-issue. A line inside an HTML comment does not count, because GitHub closes nothing from it. After you fix the description, rerun the failed jobs.
Which Rust jobs run depends on where the pull request comes from.
| Source | Jobs |
|---|---|
| A branch of this repository | lint on a GitHub-hosted ubuntu-24.04 machine. One self-hosted job on the project’s own runner runs the clippy, test and portability triggers at the same time. |
| A fork | lint, clippy, test and portability, each on a GitHub-hosted ubuntu-24.04 machine. They start from the build caches that each push to main saves. |
A push to main |
Both sets. |
When a pull request from a branch of this repository changes a world generation crate, the noise or biome crate or the block entity oracle, the job worldgen-full also runs. It runs the full profile on the project’s own runner for each changed crate of that group and the crates of the group that depend on it.
A final job, checks, fails unless every job that applies passed.
On a GitHub-hosted machine the test trigger uses the ci-hosted profile, and Cargo resolves features for the selected packages only. In CI the tests skip every crate that depends on wgpu and everything above it. Those tests run locally only, so run them yourself when you touch the client or the renderer.
A second workflow, docs, warns about pages of this site whose sources changed. Write these docs describes it.
Next: Repository checks.
Footnotes
Section titled “Footnotes”Sources and verification
Verified: 26.4-snapshot-7, 1cf84286c, 2026-11-30
- README.md
- AGENTS.md
- .config/nextest.toml
- xtask/src/checks.rs
- xtask/src/trigger.rs
- .github/workflows/checks.yml
- .github/workflows/scheduled-tests.yml
- .github/actions/rust/action.yml
- PR #691
- scripts/hooks/run-checks
- rust-toolchain.toml
- .claude/hooks/cargo-guard.sh
- crates/mcrs_minecraft_mesh/src/pack.rs
- crates/mcrs_minecraft_render/src/shader_layout_emit.rs
- crates/mcrs_minecraft_entity_model/tests/it/mob_assets.rs
- crates/mcrs_minecraft_entity_animation/tests/it/mob_assets.rs
- crates/mcrs_minecraft_client_jar/examples/fetch.rs
- docs/README.md
- tools/vanilla-server/run.sh
- issue #507
Related open issues: