Docker testing¶
Every package is tested twice:
- Unit tests against local mock HTTP servers (no network, no Docker), with coverage gates: TypeScript, Python and Java ≥ 90 % lines and branches, Rust ≥ 90 % lines and regions, Go ≥ 90 % statements.
- Integration tests against a real
local intake stub (contract-verified) + optional live Better Stack sourcein Docker. The package is packed and installed into a separate consumer project first, so the suite imports it exactly like a user does.
Run the integration suite¶
What happens per language:
docker/compose.ymlstarts Better Stack Logs (local intake stub (contract-verified) + optional live Better Stack source) and waits for its health check.- A one-shot
bootstrapcontainer prepares it (users, tokens, …) and writes the credentials to/bootstrap/env(KEY=valuelines) on a shared volume. - The
test-<lang>image (built fromdocker/Dockerfile.<lang>with the repo root as context) builds and packs the package, installs it into<lang>/integration/and runs the integration tests plus the conformance runner withGROW_BETTER_STACK_LOGS_URLpointing at the service. - The stack is always removed with
docker compose down -v, also on failure or Ctrl-C.
Every run uses its own Compose project name and publishes no host ports, so runs can happen in parallel on one machine.
Conformance scenarios¶
conformance/scenarios/*.json hold language-neutral scenarios. Each language's runner executes
the scenarios of this service's categories against the real service and reports skipped scenarios
with the reason:
core.health— health, ping, server version, closelogging.*— round trip, batching, redaction
Unit-level conformance (retries, timeouts, redaction, close twice) is covered by unit tests named
after the ids in conformance/core-unit.md.
Test fakes for your own tests¶
Each package ships in-memory fakes so your application tests need neither Docker nor network:
| Language | Module |
|---|---|
| TypeScript | @grow-codes/better-stack-logs/testing |
| Rust | grow_better_stack_logs::testing (feature testing) |
| Go | github.com/grow-codes-packages/better-stack-logs/go/testkit |
| Python | grow_better_stack_logs.testing |
| Java | codes.grow.packages.betterstack.testing |
CI¶
The ci workflow runs the unit pipelines (TypeScript on Node 22 and 24, Rust stable and 1.88,
Go 1.26 and 1.27, Python 3.10, 3.13 and 3.14, Java 17, 21 and 25) and one Docker integration job
per language. Failed Docker jobs upload the Compose logs as the artifact compose-logs-<lang>.