> 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/fr/compiler-depuis-les-sources/tests-et-verifications.md). Agents can also search and read this documentation through its [MCP server](https://docs.aethercube.fr/~gitbook/mcp).

# Tests et vérifications

Cette page liste, composant par composant, les commandes de formatage, de lint et de test que la CI lance. Elle sert à celles et ceux qui contribuent : lance les mêmes avant de pousser.

Chaque composant a un formateur, un linter et des tests. La CI les lance tous sur chaque pull request qui touche le composant.

| Composant | Formatage                          | Lint                                                             | Tests                                                                   |
| --------- | ---------------------------------- | ---------------------------------------------------------------- | ----------------------------------------------------------------------- |
| Serveur   | `./gradlew spotlessCheck`          | `./gradlew check` (Error Prone, avertissements en erreurs)       | `./gradlew check` lance les tests unitaires et réseau de chaque 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 .` ne doit rien afficher | `go vet ./...`, `golangci-lint run`                              | `go test -race ./...`                                                   |
| Protocole |                                    | `buf lint`                                                       | `buf build`, `buf breaking`                                             |

## Serveur

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

`./gradlew spotlessApply` corrige le formatage. Le build utilise le format Palantir Java.

La CI valide aussi le wrapper Gradle.

## Client et launcher

Depuis `game-client/` ou `game-launcher/` :

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

La CI du client lance aussi un contrôle de bout en bout : elle compile un serveur neuf et le rejoint avec le client headless.

## Backend

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

Les tests d'intégration ont besoin d'un vrai PostgreSQL et d'un vrai Redis. La base Redis 15 est vidée :

```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 ./...
```

Lance aussi l'analyse des vulnérabilités et les contrôles OpenAPI :

```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` ne doit pas modifier les fichiers du module.

## Protocole

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

`buf lint` ne doit rien signaler. `buf breaking` compare tes schémas avec `main`. Un changement qui casse les clients existants demande d'incrémenter la version du protocole. Sous Windows, écris `nul` à la place de `/dev/null`.

## Vecteurs inter-langages

Certains tests du serveur écrivent des fichiers dans `protocol/vectors/`, et les tests du client les lisent. Ensemble, ils prouvent que le client et le serveur sont d'accord sur les trames, les encodages de voxels, le pas de mouvement, et `sin` et `cos`.

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

Ne réécris les vecteurs que pour un changement voulu, et commite-les avec lui.

## Avant une pull request

* Le formateur et le linter passent pour chaque composant que tu as modifié.
* Les tests passent.
* Les lockfiles sont commités.
* Aucun secret, token, clé privée ni fichier `.env` n'est indexé.
* La documentation correspond à tout changement de contrat, de paquet, d'endpoint HTTP ou de clé de configuration.


---

# 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/fr/compiler-depuis-les-sources/tests-et-verifications.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.
