Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Harness ¶
Harness runs real AutoFlow flows on a production-shaped autocore engine. Flowcore drives flows; Autocore and DB are the autocore-level escape hatches for event injection, fault injection, and assertions (e.g. testautocore.WaitForState(t, h.DB, ...)).
func NewHarness ¶
func NewHarness(t *testing.T, central, workflow *pgxpool.Pool, redis rueidis.Client, opts ...Option) *Harness
NewHarness builds the production AutoFlow composition against the per-test central and workflow databases (e.g. from AutocorePostgres.WithDBs), runs the engine, and blocks until it owns its shards.
func (*Harness) SendSignal ¶
func (h *Harness) SendSignal(t *testing.T, key autocore.WorkflowKey, channel string, value proto.Message)
SendSignal delivers a channel signal to a running flow the way an external caller would; the flow receives it via signal_channel(channel). Build value with anypb so it round-trips through the engine's anypb-typed channel.
type Option ¶
type Option func(*config)
Option configures a Harness.
func WithModules ¶
func WithModules(m ...pkg_autoflow.Module) Option
WithModules registers AutoFlow modules (real or a generated MockModule) for the flow under test. Loading an unregistered module name fails the flow with a clear error.
type RemoteModule ¶
type RemoteModule struct {
TB testing.TB
Client autoflow_rpc.ModuleAPIClient
TunnelClient autoflow_rpc.ModuleTunnelAPIClient
// contains filtered or unexported fields
}
RemoteModule is a remote AutoFlow module that can be used for testing.
func (*RemoteModule) Run ¶
func (m *RemoteModule) Run(ctx context.Context)