MCPcopy Index your code
hub / github.com/riverqueue/river / requireInsertedTx

Function requireInsertedTx

rivertest/rivertest.go:145–153  ·  view source on GitHub ↗

Internal function used by the tests so that the exported version can take `testing.TB` instead of `testing.T`. Also takes a schema for testing purposes, which I haven't quite figured out how to get into the public API yet.

(ctx context.Context, t testingT, tx TTx, expectedJob TArgs, opts *RequireInsertedOpts)

Source from the content-addressed store, hash-verified

143// Also takes a schema for testing purposes, which I haven't quite figured out
144// how to get into the public API yet.
145func requireInsertedTx[TDriver riverdriver.Driver[TTx], TTx any, TArgs river.JobArgs](ctx context.Context, t testingT, tx TTx, expectedJob TArgs, opts *RequireInsertedOpts) *river.Job[TArgs] {
146 t.Helper()
147 var driver TDriver
148 actualArgs, err := requireInsertedErr[TDriver](ctx, t, driver.UnwrapExecutor(tx), expectedJob, opts)
149 if err != nil {
150 failuref(t, "Internal failure: %s", err)
151 }
152 return actualArgs
153}
154
155func requireInsertedErr[TDriver riverdriver.Driver[TTx], TTx any, TArgs river.JobArgs](ctx context.Context, t testingT, exec riverdriver.Executor, expectedJob TArgs, opts *RequireInsertedOpts) (*river.Job[TArgs], error) {
156 t.Helper()

Callers 1

TestRequireInsertedTxFunction · 0.85

Calls 3

failurefFunction · 0.85
HelperMethod · 0.65
UnwrapExecutorMethod · 0.65

Tested by 1

TestRequireInsertedTxFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…