Exercise fully exercises a driver. The driver's listener is exercised if supported.
(ctx context.Context, t *testing.T, driverWithSchema func(ctx context.Context, t *testing.T, opts *riverdbtest.TestSchemaOpts) (riverdriver.Driver[TTx], string), executorWithTx func(ctx context.Context, t *testing.T) (riverdriver.Executor, riverdriver.Driver[TTx]), )
| 17 | // Exercise fully exercises a driver. The driver's listener is exercised if |
| 18 | // supported. |
| 19 | func Exercise[TTx any](ctx context.Context, t *testing.T, |
| 20 | driverWithSchema func(ctx context.Context, t *testing.T, opts *riverdbtest.TestSchemaOpts) (riverdriver.Driver[TTx], string), |
| 21 | executorWithTx func(ctx context.Context, t *testing.T) (riverdriver.Executor, riverdriver.Driver[TTx]), |
| 22 | ) { |
| 23 | t.Helper() |
| 24 | |
| 25 | { |
| 26 | driver, _ := driverWithSchema(ctx, t, nil) |
| 27 | if driver.SupportsListener() { |
| 28 | exerciseListener(ctx, t, driverWithSchema) |
| 29 | } else { |
| 30 | t.Logf("Driver does not support listener; skipping listener tests") |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | exerciseDriverPool(ctx, t, driverWithSchema, executorWithTx) |
| 35 | exerciseMigration(ctx, t, driverWithSchema, executorWithTx) |
| 36 | exerciseNotification(ctx, t, executorWithTx) |
| 37 | exerciseSQLFragments(ctx, t, executorWithTx) |
| 38 | exerciseExecutorTx(ctx, t, driverWithSchema, executorWithTx) |
| 39 | exerciseSchemaIntrospection(ctx, t, driverWithSchema, executorWithTx) |
| 40 | exerciseSchemaName(ctx, t, driverWithSchema) |
| 41 | exerciseJobInsert(ctx, t, driverWithSchema, executorWithTx) |
| 42 | exerciseJobRead(ctx, t, executorWithTx) |
| 43 | exerciseJobUpdate(ctx, t, executorWithTx) |
| 44 | exerciseJobDelete(ctx, t, executorWithTx) |
| 45 | exerciseLeader(ctx, t, executorWithTx) |
| 46 | exerciseQueue(ctx, t, executorWithTx) |
| 47 | } |
| 48 | |
| 49 | const testClientID = "test-client-id" |
| 50 |
searching dependent graphs…