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 WaitForStateWithin(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
- type HistoryEventRecord
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, failing the test after waitTimeout. A missing row (ErrNoRows) is treated as "not created yet" and keeps polling; any other query error fails the test immediately.
func WaitForStateWithin ¶ added in v19.4.0
func WaitForStateWithin(t *testing.T, pool *pgxpool.Pool, key autocore.WorkflowKey, state persistence.WorkflowExecutionState, timeout time.Duration)
WaitForStateWithin is WaitForState with a caller-chosen bound, for a workflow whose legitimate run time exceeds waitTimeout.
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 ¶
DBs holds the connection files Bootstrap wrote, in the layout a deployment mounts them in.
type HistoryEventRecord ¶ added in v19.4.0
type HistoryEventRecord struct {
SequenceID persistence.SequenceID
Payload *persistence.HistoryEventPayload
DebugPayload *persistence.HistoryEventDebugPayload
}
HistoryEventRecord is one history_event row with both payload columns decoded. DebugPayload is an empty message for an event that stores none.
func HistoryEventRecords ¶ added in v19.4.0
func HistoryEventRecords(t *testing.T, pool *pgxpool.Pool, key autocore.WorkflowKey) []HistoryEventRecord
HistoryEventRecords returns the workflow's history event rows ordered by sequence_id, for callers that need an event's id or its debug payload rather than the payload alone.