goldenassert

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package goldenassert is the shared TEST helper for the golden-payload fixtures under internal/eventpayload/testdata — the cross-channel drift lock for the stable event `data` payloads.

Each fixture file is a full wire envelope {type,id,schema_version, created_at,data}. The canonical envelope-level lock lives in internal/eventpayload's own golden test; the per-builder tests (relay, agent, delivery, ws) call Data to assert that THEIR builder's marshaled `data` is byte-identical to the fixture's `data` subdocument. The TS and Python SDK payload tests parse the very same files, so a server-side field rename that would break an SDK type fails both sides against one artifact.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Data

func Data(t *testing.T, path string, got any)

Data asserts that json.Marshal(got) is byte-identical to the (compacted) `data` subdocument of the fixture at path.

func DataIgnoringLifecycle added in v1.4.1

func DataIgnoringLifecycle(t *testing.T, path string, got any, extraFields ...string)

DataIgnoringLifecycle asserts the non-ledger portion of a producer payload. Pure builder tests use it because they do not own persistence and therefore must never be fed fixture-derived transitions. DB-backed producer tests lock the exact persisted rows separately.

func Lifecycle added in v1.4.1

func Lifecycle(t *testing.T, path string, got any)

Lifecycle compares lifecycle rows emitted by a real producer to the static fixture, normalizing only database-generated identity and observation-time fields. Evidence, correlations, recipient, taxonomy, retryability, and presence remain byte-for-byte locked to the fixture. Rows are matched by reason code because equal occurred_at values use generated ids as the deterministic production tie-breaker; DB ordering tests lock that rule.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL