# Testing

Run unit and integration tests against a broker version

Package: @cookiemonsterdev/kafka-core 2.8.1
Canonical: https://cookiemonsterdev.github.io/kafka/docs/core/guides/testing/
Source revision: b112a684d2b3cdc7deadb3513041fcdbdc1c18b5

Unit tests do not start Docker. Integration tests pick a compose file from
`KAFKA_VERSION` (default `4.0`):

```sh
pnpm --filter @cookiemonsterdev/kafka-core test
KAFKA_VERSION=0.10 pnpm --filter @cookiemonsterdev/kafka-core test:integration
KAFKA_VERSION=4.0 pnpm --filter @cookiemonsterdev/kafka-core test:integration
KAFKA_VERSION=4.3 pnpm --filter @cookiemonsterdev/kafka-core test:integration
```

Leave a cluster running with `DO_NOT_STOP=1`, or point at an already-running
cluster with `KAFKA_EXTERNAL=1`. The mapping lives in
[`packages/core/test/assets/README.md`](https://github.com/cookieMonsterDev/kafka/blob/master/packages/core/test/assets/README.md).

The tested broker matrix is on [Compatibility](https://cookiemonsterdev.github.io/kafka/docs/core/reference/compatibility/).
SASL/GSSAPI is covered by unit tests only; there is no Kerberos compose stack
in CI.
