Skip to content

Local Development: Testing And Verification

Stage: Alpha Status: In Progress

Use this page after you have the local environment running or when validating a patch.

Fast Feedback

Run all unit tests:

just test
go test ./...

Run focused packages:

go test ./internal/irtop ./cmd/irtop
go test ./internal/api ./internal/db
go test ./internal/cli/admin ./internal/cli/client

Run e2e tests:

just test-e2e

Formatting, Vet, Lint

Format code:

just fmt

Check formatting without changing files:

just fmt-check

Run vet:

just vet

Run lint if installed:

just lint

Docs

Preview docs locally:

just docs-serve

Build docs in strict mode:

just docs-build

MkDocs may print informational messages for pages not included in navigation. Treat broken links, config errors, and build failures as blockers.

Telemetry Testing

Start the local observability stack from examples/otel/, then run IronRoot with OTEL variables:

OTEL_EXPORTER_OTLP_ENDPOINT=localhost:4317 \
OTEL_SERVICE_NAME=ironroot-local \
go run ./cmd/server --config .localdev/config/config.yaml

Run client commands in another terminal to generate traces and metrics.

git checkout -b fix/my-change
just fmt
just test
just test-e2e
just lint
just docs-build
just build-local

Then manually verify the local flow that your patch changed.

High-Risk Areas

Run broader checks when touching:

  • internal/db: migrations and repository tests
  • internal/api: router and status tests
  • internal/ca: local PKI tests and certificate chain verification
  • internal/cli/*: command tests and e2e tests
  • internal/irtop: package tests plus manual irtop --server http://localhost:8443
  • docs or examples: just docs-build

Manual Smoke Flow

After large changes:

just build-local
ironroot-dev dev-init --force
ironroot-admin ca create-root --name "IronRoot Local Root CA" --key-password ironroot-local-root --out .localdev/pki/root
ironroot-admin ca create-intermediate --root-cert .localdev/pki/root/root-ca.crt --root-key .localdev/pki/root/root-ca.key --root-password ironroot-local-root --password ironroot-local-intermediate --out .localdev/pki/intermediate
ironroot-admin bootstrap --config .localdev/config/config.yaml --non-interactive --acknowledge-risk
ironroot-server --config .localdev/config/config.yaml

In another terminal, create a token, enroll, request a cert, and open irtop.