relaytest

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package relaytest holds the conformance specs every relay.IRegistry implementation must pass, and the messaging specs every relay.Relay[Body] must pass over such a registry. The in-memory registry runs them today; the durable csfpg-backed registry (slice A1) runs exactly the same specs, so the two cannot drift apart on the semantics written on relay.IRegistry. Both suites are generic: the registry suite over the registry's own type, the messaging suite over the message contract the relay carries.

Ginkgo and Gomega are imported qualified because this is a library, not a test file: dot-importing an assertion vocabulary into a production namespace is what CS-11's library counterweight forbids.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DescribeRegistryConformance

func DescribeRegistryConformance[Registry relay.IRegistry](name string, newRegistry func() Registry) bool

DescribeRegistryConformance registers the IRegistry conformance specs under name. newRegistry builds one empty registry per spec; it runs inside a BeforeEach, so it may call ginkgo.DeferCleanup to release a database or schema. Call it at package level in a Ginkgo suite:

var _ = relaytest.DescribeRegistryConformance("MemoryRegistry", relay.NewMemoryRegistry)

func DescribeRelayConformance

func DescribeRelayConformance[Body any, Registry relay.IRegistry](name string, newRegistry func() Registry, newBody func(sequence int) Body) bool

DescribeRelayConformance registers the messaging conformance specs for a relay carrying Body over the registries newRegistry builds. newBody makes distinct messages of the relay's contract; the specs compare what arrives with gomega.Equal, so Body must compare by value or be a type gomega's equality understands (protobuf messages included). Call it at package level in a Ginkgo suite:

var _ = relaytest.DescribeRelayConformance("Relay[string]", relay.NewMemoryRegistry,
	func(sequence int) string { return fmt.Sprint("message ", sequence) })

Types

This section is empty.

Jump to

Keyboard shortcuts

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