Documentation
¶
Index ¶
- func HistoryEvents(t *testing.T, pool *pgxpool.Pool, key autocore.WorkflowKey) []*persistence.HistoryEventPayload
- func HistoryKinds(t *testing.T, pool *pgxpool.Pool, key autocore.WorkflowKey) []string
- func ScheduledTaskKinds(t *testing.T, pool *pgxpool.Pool, key autocore.WorkflowKey) []string
- func ScheduledTasks(t *testing.T, pool *pgxpool.Pool, key autocore.WorkflowKey) []*persistence.ScheduledTaskPayload
- 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 HistoryEvents ¶ added in v19.3.0
func HistoryEvents(t *testing.T, pool *pgxpool.Pool, key autocore.WorkflowKey) []*persistence.HistoryEventPayload
HistoryEvents returns the workflow's history event payloads ordered by sequence_id.
func HistoryKinds ¶
HistoryKinds returns the workflow's history event kinds (oneof field names, e.g. "signal_received", "workflow_completed") ordered by sequence_id.
func ScheduledTaskKinds ¶ added in v19.3.0
ScheduledTaskKinds returns the kinds (oneof field names, e.g. "timer", "workflow_timeout") of the workflow's outstanding scheduled_task rows, ordered by fire time. Every workflow carries a "workflow_timeout" task for its schedule-to-complete deadline, so callers looking for timers must filter.
func ScheduledTasks ¶ added in v19.3.0
func ScheduledTasks(t *testing.T, pool *pgxpool.Pool, key autocore.WorkflowKey) []*persistence.ScheduledTaskPayload
ScheduledTasks returns the workflow's outstanding scheduled_task payloads ordered by fire time.
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.