Documentation
¶
Index ¶
- func HistoryKinds(t *testing.T, pool *pgxpool.Pool, key autocore.WorkflowKey) []string
- func WaitForState(t *testing.T, pool *pgxpool.Pool, key autocore.WorkflowKey, ...)
- func WorkflowExecutionState(t *testing.T, pool *pgxpool.Pool, key autocore.WorkflowKey) persistence.WorkflowExecutionState
- type AutocorePostgres
- type DBs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HistoryKinds ¶
HistoryKinds returns the workflow's history event kinds (oneof field names, e.g. "signal_received", "workflow_completed") ordered by sequence_id.
func WaitForState ¶
func WaitForState(t *testing.T, pool *pgxpool.Pool, key autocore.WorkflowKey, state persistence.WorkflowExecutionState)
WaitForState polls until the workflow addressed by key reaches the given state. A missing row (ErrNoRows) is treated as "not created yet" and keeps polling; any other query error fails the test immediately.
func WorkflowExecutionState ¶
func WorkflowExecutionState(t *testing.T, pool *pgxpool.Pool, key autocore.WorkflowKey) persistence.WorkflowExecutionState
WorkflowExecutionState returns the current execution state of the workflow.
Types ¶
type AutocorePostgres ¶
type AutocorePostgres struct {
// contains filtered or unexported fields
}
AutocorePostgres is a Postgres test container preloaded with the autocore central and workflow schema templates. Each WithDBs call clones a fresh pair of logical databases for one test.
func NewContainer ¶
func NewContainer(t testing.TB) *AutocorePostgres
NewContainer starts one Postgres container with the autocore template schemas. Typically called once from a suite's SetupSuite.
type DBs ¶
type DBs struct {
CentralDSN string
WorkflowDSN string
ShardIDs []persistence.ShardID
}
DBs holds the reconstructed DSNs and shard IDs produced by Bootstrap.