How to Run Tests for the Brush Project: A Complete Guide
Run cargo test --all --all-features from the repository root to execute the complete test suite for the Brush project, matching the command used in the CI workflow defined in .github/workflows/ci.yml.
The Brush project (ArthurBrussee/brush) is a Rust-based 3D Gaussian splatting tool organized as a Cargo workspace. Whether you are contributing new features or verifying local changes, knowing how to run tests for the Brush project ensures code quality across all workspace crates.
Prerequisites
Before executing any tests, ensure you have Rust installed (version ≥ 1.88 as required by the codebase). Clone the repository and navigate to the root directory:
git clone https://github.com/ArthurBrussee/brush.git
cd brush
Running the Full Test Suite
To validate the entire workspace as the CI does, use the all-features flag. According to the test workflow in .github/workflows/ci.yml, the official command is:
cargo test --all --all-features
This command builds every crate defined in the workspace Cargo.toml and executes both unit and integration tests while enabling all optional feature flags.
Testing Specific Components
For targeted validation, you can isolate test execution to specific crates or documentation examples.
Running Documentation Tests
To verify code examples embedded in the Rust documentation, append the --doc flag:
cargo test --all --all-features --doc
This ensures that examples in doc comments remain accurate and compile correctly.
Testing Individual Crates
When working on a specific module like brush-loss, run tests for only that crate using the -p flag:
cargo test -p brush-loss --all-features
Replace brush-loss with any workspace member (e.g., brush-bench-test) as defined in the root Cargo.toml. Individual test files like crates/brush-loss/tests/reference.rs contain the actual test implementations executed by this command.
Understanding the Test Configuration
The repository’s testing logic is governed by two key files:
.github/workflows/ci.yml: Defines the macOS CI runner steps that executecargo test --all --all-featuresand doc tests.Cargo.toml: Located at the workspace root, this file declares all member crates that--allincludes in the test run.
Summary
- Use
cargo test --all --all-featuresto run the complete test suite matching CI behavior. - Append
--docto validate documentation examples. - Use
-p <crate-name>to test individual workspace members likebrush-loss. - Reference
.github/workflows/ci.ymlfor the authoritative test configuration.
Frequently Asked Questions
What is the minimum Rust version required to run Brush tests?
The codebase requires Rust 1.88 or higher. Attempting to run tests with older versions may result in compilation errors due to modern language features used in the workspace.
How do I run tests for only one specific crate in the Brush workspace?
Use the -p flag followed by the crate name: cargo test -p brush-loss --all-features. This targets only the tests within that crate’s directory (such as those in crates/brush-loss/tests/) without building the entire workspace.
Does cargo test --all include all features?
No, cargo test --all runs tests with default features only. To match the CI environment and test all code paths—including optional functionality—you must add --all-features as specified in .github/workflows/ci.yml.
Where are the actual test files located in the Brush repository?
Test implementations reside within each crate’s directory. For example, integration tests for the loss calculations exist in crates/brush-loss/tests/reference.rs, while the workspace declaration in the root Cargo.toml determines which crates participate when running cargo test --all.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →