stdrivertest

package
v0.0.128 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package stdrivertest provides test utilities for our River abstraction.

Index

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 JobInState(expectState ...rivertype.JobState) func(jr *rivertype.JobRow) bool

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL