Skip to main content

Testing

Tests should prove the contract at the boundary being changed. Keep fixtures small, redacted, and based on real behavior.

Unit Tests

Use Go unit tests for parsing, config validation, provider conversion, tool schemas, repository behavior, channel normalization, and prompt/context builders.

Run focused package tests while iterating, then run the standard handoff check for code changes.

RPC Tests

RPC tests should verify method names, params, error codes, redaction, and payload shape. Shared method constants live in internal/protocol.

Dashboard, TUI, and channels should consume RPC contracts instead of duplicating gateway behavior.

Smoke Tests

make smoke-local runs the smoke-tagged local checks. Use it for local product flow confidence when changing runtime assembly or high-level behavior.

Do not depend on live external services in ordinary smoke tests.

Dashboard Tests

Dashboard tests use fake RPC clients and Go HTTP handlers. Some interactive flows use browser automation patterns in existing dashboard tests.

Add coverage for form submissions, redirects, status fragments, localization, and RPC allowlist changes.

Live Tests

Live tests must be opt-in through environment gates, such as channel live-smoke variables. They should use safe test accounts or targets.

Document required env vars and keep live tests skipped by default.