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

Function requireNotInsertedTx

rivertest/rivertest.go:253–260  ·  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

251// Also takes a schema for testing purposes, which I haven't quite figured out
252// how to get into the public API yet.
253func requireNotInsertedTx[TDriver riverdriver.Driver[TTx], TTx any, TArgs river.JobArgs](ctx context.Context, t testingT, tx TTx, expectedJob TArgs, opts *RequireInsertedOpts) {
254 t.Helper()
255 var driver TDriver
256 err := requireNotInsertedErr[TDriver](ctx, t, driver.UnwrapExecutor(tx), expectedJob, opts)
257 if err != nil {
258 failuref(t, "Internal failure: %s", err)
259 }
260}
261
262func requireNotInsertedErr[TDriver riverdriver.Driver[TTx], TTx any, TArgs river.JobArgs](ctx context.Context, t testingT, exec riverdriver.Executor, expectedJob TArgs, opts *RequireInsertedOpts) error {
263 t.Helper()

Callers 1

TestRequireNotInsertedTxFunction · 0.85

Calls 3

failurefFunction · 0.85
HelperMethod · 0.65
UnwrapExecutorMethod · 0.65

Tested by 1

TestRequireNotInsertedTxFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…