Documentation
¶
Overview ¶
Package reactortest is the contract suite that every Reactor backend (Pg and in-memory consumer Runtimes) must pass. A test calls
reactortest.Run(t, func(t *testing.T, codec *eventstore.Codec) reactortest.Backend { ... })
and the suite exercises the Reactor only through its public API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend struct {
// Store and UnitOfWork write events; Store encodes with the suite's
// codec.
Store eventstore.Store
UnitOfWork eventstore.UnitOfWork
Runtime consumer.Runtime
// Redeliver hands env to r's live handler once more, as after a crash
// between handling an event and advancing the Cursor.
Redeliver func(ctx context.Context, r *reactor.Reactor, env eventstore.Envelope) error
// Discarded lists the audit records Discard kept for r, in the order
// they were discarded.
Discarded func(ctx context.Context, r *reactor.Reactor) ([]Discarded, error)
}
Backend is one empty event log with a consumer Runtime over it.
type Option ¶
type Option func(*config)
Option configures Run.
func InBubble ¶
func InBubble() Option
InBubble runs every case inside a testing/synctest bubble, so retries and timeouts use fake time. For in-memory backends.
func Sequential ¶
func Sequential() Option
Sequential runs the cases one after another, for Pg backends whose databases share one cluster (pg_snapshot_xmin is cluster-wide).
Click to show internal directories.
Click to hide internal directories.