conformance

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package conformance provides a reusable test suite for implementations of the messaging Publisher and Subscriber ports.

Transport adapters call Run from their own tests. The suite uses real time, so it works for adapters that perform network I/O; adapters that are purely in-process may also run it inside a testing/synctest bubble.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

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

Run verifies an at-least-once publish/subscribe round trip: the subscriber receives and acknowledges the message with its ID, payload and headers preserved, and Subscribe keeps running until its context ends.

Publish and Subscribe share one context with a one-second deadline, so a context-aware adapter fails the test instead of hanging it. Run publishes the same envelope repeatedly until it is delivered, so adapters that register subscriptions asynchronously need no test-only synchronization.

Types

type Factory

type Factory func(t *testing.T) (messaging.Publisher[string], messaging.Subscriber[string], func())

Factory creates the publisher and subscriber under test, typically the same adapter value, and an optional cleanup function that Run calls when it finishes.

Jump to

Keyboard shortcuts

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