Testing

Current testing is intentionally minimal and aligned with the current binaries.

Test Layers

  1. Go tests: make test
  2. BATS CLI tests: make test-e2e
  3. Containerized BATS mesh tests: make test-e2e-container

Commands

make build
make test
make test-e2e
make test-e2e-container

Go Tests

Run all Go tests with race detection:

make test

Run only integration package:

go test ./tests/integration/...

BATS CLI Tests

These tests validate current command behavior for:

  • sam-node
  • sam-hub

Run:

make test-e2e

Containerized Mesh BATS

The container framework is implemented in:

  • tests/e2e/lib/container_mesh.bash

It starts:

  1. mock OIDC container
  2. sam-hub container
  3. multiple sam-node containers

Run:

make test-e2e-container

Optional image override:

MESH_RUNTIME_IMAGE=sam-e2e-runtime:dev make test-e2e-container

Troubleshooting

  • Ensure Docker daemon is running before container tests.
  • Ensure bats is installed and available in PATH.
  • If a test fails, inspect containers:
docker ps -a
docker logs <container-name>