conformance

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package conformance is the cross-transport parity test framework.

Per § Protocol versioning → Conformance suite, this is the normative source where the architecture doc and an executable test disagree.

v0.1 ships the in-memory transport adapter and the fake-clock interface; PR-gating tests use those for determinism. A nightly pass against real Unix sockets / loopback TCP is configured in CI and not exposed here.

Package conformance is part of the GoFastr harness.

See docs/harness-architecture.md for the architecture this package implements.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InprocFactory

func InprocFactory(t *testing.T, h *Harness) (control.Client, <-chan control.EventEnvelope)

InprocFactory is a built-in ClientFactory backed by the in-process transport. It's the baseline every other transport is compared to.

func Run

func Run(t *testing.T, factory ClientFactory)

Run runs every scenario in the suite against the provided factory. Implementations of the transport under test call this from their own *_test.go file to opt into the conformance matrix.

Types

type ClientFactory

type ClientFactory func(t *testing.T, h *Harness) (control.Client, <-chan control.EventEnvelope)

ClientFactory returns a fresh Client wired through the transport under test. The scenario uses the returned Client to send commands and the returned channel to read events.

type Harness

type Harness struct {
	Mux    *multiplex.Mux
	Engine *engine.Engine
	Bus    *engine.Bus
	Clock  clock.Clock
}

Harness is the test setup the scenarios run against. Transports provide their own factory functions that fulfill ClientFactory.

type Scenario

type Scenario struct {
	Name string
	Run  func(t *testing.T, h *Harness, factory ClientFactory)
}

Scenario is a single conformance test. Each scenario is transport-agnostic: it talks to whatever ClientFactory produces.

func AllScenarios

func AllScenarios() []Scenario

AllScenarios returns the v0.1 scenario set.

Jump to

Keyboard shortcuts

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