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

Function TestClientDriverPlugin

plugin_test.go:19–57  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17)
18
19func TestClientDriverPlugin(t *testing.T) {
20 t.Parallel()
21
22 ctx := context.Background()
23
24 type testBundle struct {
25 pluginDriver *TestDriverWithPlugin
26 }
27
28 setup := func(t *testing.T) (*Client[pgx.Tx], *testBundle) {
29 t.Helper()
30
31 var (
32 dbPool = riversharedtest.DBPool(ctx, t)
33 driver = riverpgxv5.New(dbPool)
34 schema = riverdbtest.TestSchema(ctx, t, driver, nil)
35 config = newTestConfig(t, schema)
36 )
37
38 pluginDriver := newDriverWithPlugin(t, dbPool)
39
40 client, err := NewClient(pluginDriver, config)
41 require.NoError(t, err)
42
43 return client, &testBundle{
44 pluginDriver: pluginDriver,
45 }
46 }
47
48 t.Run("InitCalled", func(t *testing.T) {
49 t.Parallel()
50
51 client, bundle := setup(t)
52
53 startClient(ctx, t, client)
54
55 require.True(t, bundle.pluginDriver.initCalled)
56 })
57}
58
59var _ driverPlugin[pgx.Tx] = &TestDriverWithPlugin{}
60

Callers

nothing calls this directly

Calls 9

DBPoolFunction · 0.92
NewFunction · 0.92
TestSchemaFunction · 0.92
newDriverWithPluginFunction · 0.85
NewClientFunction · 0.85
newTestConfigFunction · 0.70
startClientFunction · 0.70
HelperMethod · 0.65
RunMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…