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

Function requireManyInsertedTx

rivertest/rivertest.go:394–402  ·  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, expectedJobs []ExpectedJob)

Source from the content-addressed store, hash-verified

392// Also takes a schema for testing purposes, which I haven't quite figured out
393// how to get into the public API yet.
394func requireManyInsertedTx[TDriver riverdriver.Driver[TTx], TTx any](ctx context.Context, t testingT, tx TTx, expectedJobs []ExpectedJob) []*rivertype.JobRow {
395 t.Helper()
396 var driver TDriver
397 actualArgs, err := requireManyInsertedErr[TDriver](ctx, t, driver.UnwrapExecutor(tx), expectedJobs)
398 if err != nil {
399 failuref(t, "Internal failure: %s", err)
400 }
401 return actualArgs
402}
403
404func requireManyInsertedErr[TDriver riverdriver.Driver[TTx], TTx any](ctx context.Context, t testingT, exec riverdriver.Executor, expectedJobs []ExpectedJob) ([]*rivertype.JobRow, error) {
405 t.Helper()

Callers 1

Calls 3

failurefFunction · 0.85
HelperMethod · 0.65
UnwrapExecutorMethod · 0.65

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…