> For the complete documentation index, see [llms.txt](https://docs.aethercube.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aethercube.fr/developers/building-from-source/tests-and-checks.md). Agents can also search and read this documentation through its [MCP server](https://docs.aethercube.fr/~gitbook/mcp).

# Tests and checks

Every component has a formatter, a linter and tests. This page lists the commands, so you can run them yourself and know your change is sound.

| Component | Formatting                      | Lint                                                             | Tests                                                              |
| --------- | ------------------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------ |
| Server    | `./gradlew spotlessCheck`       | `./gradlew check` (Error Prone, warnings as errors)              | `./gradlew check` runs the unit and network tests of every module. |
| Client    | `cargo fmt --all -- --check`    | `cargo clippy --workspace --all-targets --locked -- -D warnings` | `cargo test --workspace --locked`                                  |
| Launcher  | `cargo fmt --all -- --check`    | `cargo clippy --workspace --all-targets --locked -- -D warnings` | `cargo test --workspace --locked`                                  |
| Backend   | `gofmt -l .` must print nothing | `go vet ./...`, `golangci-lint run`                              | `go test -race ./...`                                              |
| Protocol  |                                 | `buf lint`                                                       | `buf build`, `buf breaking`                                        |

## Server

```sh
cd game-server
./gradlew spotlessCheck
./gradlew check
```

`./gradlew spotlessApply` fixes formatting. The build uses the Palantir Java format.

## Client and launcher

Run from `game-client/` or `game-launcher/`:

```sh
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked
```

An end-to-end check is also worth running: build a fresh server and join it with the headless client.

## Backend

```sh
cd backend-services
gofmt -l .
go vet ./...
golangci-lint run
go test ./...
```

Integration tests need a real PostgreSQL and Redis. Redis database 15 is flushed:

```sh
AETHERCUBE_TEST_DATABASE_URL="postgres://backend:pw@127.0.0.1:5432/aethercube_test?sslmode=disable" \
AETHERCUBE_TEST_REDIS_ADDR=127.0.0.1:6379 \
go test -race ./...
```

Also run the vulnerability scan and the OpenAPI checks:

```sh
go run golang.org/x/vuln/cmd/govulncheck@latest ./...
python scripts/gen_openapi.py api/openapi.yaml
python scripts/check_openapi.py .
```

`go mod tidy` must leave the module files unchanged.

## Protocol

```sh
cd protocol
buf lint
buf build -o /dev/null
buf breaking --against "../.git#ref=origin/main,subdir=protocol"
```

`buf lint` must report nothing. `buf breaking` compares your schemas with `main`. A change that breaks existing clients needs a protocol version bump. On Windows, write `nul` instead of `/dev/null`.

## Cross-language vectors

Some tests in the server write files into `protocol/vectors/`, and the client tests read them. Together they prove that the client and the server agree on frames, voxel encodings, the movement step and `sin` and `cos`.

```sh
cd game-server
AETHERCUBE_WRITE_VECTORS=1 ./gradlew :server-network:test :server-world:test :server-physics:test
```

Rewrite the vectors only for an intended change, and commit them with it.

## Before you share a change

* The formatter and the linter pass for every component you changed.
* The tests pass.
* Lockfiles are committed.
* No secret, token, private key or `.env` file is staged.
* The documentation matches any change to a contract, a packet, an HTTP endpoint or a configuration key.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aethercube.fr/developers/building-from-source/tests-and-checks.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
