Help us shape the future of Go! Take the 2026 Go Developer Survey

testworkflow

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package testworkflow contains a small deterministic graph used only by the bridge integration and recovery tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefinition

func NewDefinition(store flow.CheckpointStore) (*bridge.TypedDefinition[CounterState], error)

NewDefinition builds the two-vertex counter over the caller's neutral Flow checkpoint store. The graph and vertex IDs are stable across restarts.

func NewDefinitionWithGate

func NewDefinitionWithGate(store flow.CheckpointStore, gate <-chan struct{}) (*bridge.TypedDefinition[CounterState], error)

NewDefinitionWithGate is the same graph with an optional test-only gate before each vertex. It lets the integration test prove that workflow_start returns after the durable seed rather than after graph completion.

func NewDefinitionWithGateAndSignal

func NewDefinitionWithGateAndSignal(store flow.CheckpointStore, gate <-chan struct{}, entered chan<- struct{}) (*bridge.TypedDefinition[CounterState], error)

NewDefinitionWithGateAndSignal is the integration-test variant that signals once a live vertex has entered the optional gate. The signal is bounded to one non-blocking send so a test cannot make workflow execution depend on its own observer.

Types

type CounterState

type CounterState struct {
	Count int `json:"count"`
}

CounterState is intentionally small so integration tests can assert the durable result without exposing application payloads through activities.

Jump to

Keyboard shortcuts

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