Skip to main content
The Go test integration is the varianztest package in the SDK module — no separate install:
vt.NewSession(t, endpoint) registers cleanup with t — stages are removed and the session destroyed when the test ends. Run go test with the standard environment (VARIANZ_ENABLED=true, and VARIANZ_INSECURE_ALLOW_PLAINTEXT=true for a plaintext local registry).

Stage examples

Field names in args follow the Go SDK’s field-naming rulesBasePrice is args.base_price unless tagged otherwise.

Session API

Sample assertions

HasValue takes a dot path into the sampled value ("" for the value itself); Samples() on the assertion returns the collected raw samples when you need custom checks.

In-process calls

When the code under test is in the same process, put the session on the context instead of a header: