Portals.Conformance.Runner (portals v0.1.0)

Copy Markdown View Source

Black-box protocol conformance runner (FR-7 / Phase 1 exit criteria).

Tests a codec purely through the Portals.Codec behaviour — encode a frame envelope, decode it back, and check the fixed-shape golden vectors and malformed fixtures shared by every SDK. A worker SDK's own codec can be exercised by this runner over a language-neutral bridge (e.g. driving the SDK's binary through stdin/stdout) as long as that bridge exposes the same encode/2 and decode/2 contract; no Elixir-internal knowledge of the codec under test is required.

Vectors live in protocol/vectors/golden.exs; malformed fixtures live in protocol/malformed/fixtures.exs. Both are plain data files (no macros, no codec-specific syntax) so every SDK's test suite can load and replay them independently.

Summary

Functions

Run every golden vector and malformed fixture against codec (a module implementing Portals.Codec).

Types

codec_module()

@type codec_module() :: module()

failure()

@type failure() :: %{name: binary(), reason: term()}

result()

@type result() :: %{passed: non_neg_integer(), failed: [failure()]}

Functions

golden_vectors()

@spec golden_vectors() :: [{binary(), list()}]

malformed_fixtures()

@spec malformed_fixtures() :: [{binary(), binary(), atom()}]

run(codec, limits \\ Protocol.default_limits())

Run every golden vector and malformed fixture against codec (a module implementing Portals.Codec).