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) bool
- func WaitForJob(ctx context.Context, tb testing.TB, txr *stdtx.Transactor[pgx.Tx], ...) (jobs []*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 WaitForJob ¶
func WaitForJob( 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) }, args stdriverfx.JobArgs, expectN int, stateFn func(job *rivertype.JobRow) bool, ) (jobs []*rivertype.JobRow)
WaitForJob will wait for a job to be in one of the provided states.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.