stdrivertest

package
v0.0.191 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 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, _ error) bool

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.

Jump to

Keyboard shortcuts

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