| title | Testing |
|---|---|
| linkTitle | Testing |
Current testing is intentionally minimal and aligned with the current binaries.
- Go tests:
make test - BATS CLI tests:
make test-e2e - Containerized BATS mesh tests:
make test-e2e-container - Console UI tests:
make ui-test
make build
make test
make test-e2e
make test-e2e-container
make ui-testRun all Go tests with race detection:
make testRun only integration package:
go test ./tests/integration/...These tests validate current command behavior for:
sam-nodesam-control-planesam-router
Run:
make test-e2eThe container framework is implemented in:
tests/e2e/lib/container_mesh.bash
It starts:
- mock OIDC container
sam-control-planecontainersam-routercontainer- multiple
sam-nodecontainers
Run:
make test-e2e-containerOptional image override:
MESH_RUNTIME_IMAGE=sam-e2e-runtime:dev make test-e2e-containerPlaywright drives the console in tests/ui/console.spec.js. The stack is built
in tests/ui/lib/stack.sh and runs entirely as local processes against a
throwaway sqlite database, so no docker, kind or postgres is involved.
make ui-test
make ui-test WHAT="policy editor" # --grep a subsetTo click around that same stack instead of asserting against it:
make ui-devThat seeds a mesh policy, enrolls a router and a node with bootstrap tokens, then leaves the console running with its URL and admin token printed. Only the OIDC issuer is a stand-in: it serves a discovery document but cannot sign tokens, which is why enrollment uses bootstrap tokens rather than a JWT.
The console serves its static assets from cmd/sam-console/public, so edits to
the HTML, CSS or JS need only a browser refresh; only Go changes need a rebuild.
- Ensure Docker daemon is running before container tests.
- Ensure
batsis installed and available inPATH. - If a test fails, inspect containers:
docker ps -a
docker logs <container-name>