MCPcopy Create free account
hub / github.com/riverqueue/river / RequireInsertedTx

Function RequireInsertedTx

rivertest/rivertest.go:135–138  ·  view source on GitHub ↗

RequireInsertedTx is a test helper that verifies that a job of the given kind was inserted for work, failing the test if it wasn't. If found, the inserted job is returned so that further assertions can be made against it. job := RequireInsertedTx[*riverpgxv5.Driver](ctx, t, tx, &Job1Args{}, nil)

(ctx context.Context, tb testing.TB, tx TTx, expectedJob TArgs, opts *RequireInsertedOpts)

Source from the content-addressed store, hash-verified

133// because at that point the job to return is ambiguous. Use RequireManyInserted
134// to cover that case instead.
135func RequireInsertedTx[TDriver riverdriver.Driver[TTx], TTx any, TArgs river.JobArgs](ctx context.Context, tb testing.TB, tx TTx, expectedJob TArgs, opts *RequireInsertedOpts) *river.Job[TArgs] {
136 tb.Helper()
137 return requireInsertedTx[TDriver](ctx, tb, tx, expectedJob, opts)
138}
139
140// Internal function used by the tests so that the exported version can take
141// `testing.TB` instead of `testing.T`.

Callers 1

Example_requireInsertedFunction · 0.92

Calls 1

HelperMethod · 0.65

Tested by 1

Example_requireInsertedFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…