eventbustest

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Overview

Package eventbustest ships the backend-conformance suite for the events.EventBus transport seam (spec D4.6). Any EventBus implementation — the in-process builtin today, config-selected external adapters (Kafka, NATS, Redis) post-v1 — must pass this identical battery: it exercises the D4.1 interface (Publish/Subscribe semantics, topic routing, the unsubscribe func, Close drain) and asserts the D4.2 G1–G4 floor. A new backend is validated mechanically by re-running the suite against its constructor, not by a hand-written re-proof.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

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

Run executes the full conformance battery against the backend produced by factory, asserting only the D4.2 G1–G4 floor.

func RunWithOptions

func RunWithOptions(t *testing.T, factory Factory, opts Options)

RunWithOptions is Run with capability opt-ins enabled per opts.

Types

type Factory

type Factory func() events.EventBus

Factory constructs a fresh backend under test. The suite calls it once per check so state never leaks between checks.

type Options

type Options struct {
	// OrderedPerTopic additionally asserts publish-order delivery per
	// topic. The G2 floor is best-effort only (partitioned backends MAY
	// reorder), so this is opt-in for backends — like the in-process
	// builtin — that do guarantee per-topic order.
	OrderedPerTopic bool
}

Options tunes the suite for backend capabilities that exceed the floor.

type TB

type TB interface {
	Helper()
	Errorf(format string, args ...any)
	Fatalf(format string, args ...any)
}

TB is the narrow testing surface the checks report through. *testing.T satisfies it; a fake can drive the checks against deliberately broken backends to prove the suite itself has teeth.

Jump to

Keyboard shortcuts

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