Documentation
¶
Overview ¶
Package stdrivertest provides test utilities for our River abstraction.
Index ¶
- func EnqueueJob[T stdriverfx.JobArgs](ctx context.Context, tb testing.TB, txr *stdtx.Transactor[pgx.Tx], ...)
- func JobInState(expectState ...rivertype.JobState) func(jr *rivertype.JobRow, _ error) bool
- func WaitForJobsByKind(ctx context.Context, tb testing.TB, txr *stdtx.Transactor[pgx.Tx], ...) (res []*rivertype.JobRow)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnqueueJob ¶
func EnqueueJob[T stdriverfx.JobArgs]( ctx context.Context, tb testing.TB, txr *stdtx.Transactor[pgx.Tx], enq stdriverfx.Enqueuer[T], args T, )
EnqueueJob will enqueue a job for testing.
func JobInState ¶
func WaitForJobsByKind ¶ added in v0.0.131
func WaitForJobsByKind( ctx context.Context, tb testing.TB, txr *stdtx.Transactor[pgx.Tx], wrk interface { GetJobByKinds( ctx context.Context, tx pgx.Tx, kind string, moreKinds ...string, ) (*river.JobListResult, error) }, kind string, expN int, filterFn func(job *rivertype.JobRow, jerr error) bool, ) (res []*rivertype.JobRow)
WaitForJobsByKind will wait for N jobs of a certain kind to be in one of the provided states.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.