MCPcopy
hub / github.com/riverqueue/river / TestClientPilotPlugin

Function TestClientPilotPlugin

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

Source from the content-addressed store, hash-verified

86}
87
88func TestClientPilotPlugin(t *testing.T) {
89 t.Parallel()
90
91 ctx := context.Background()
92
93 type testBundle struct {
94 pluginDriver *TestDriverWithPlugin
95 pluginPilot *TestPilotWithPlugin
96 }
97
98 setup := func(t *testing.T) (*Client[pgx.Tx], *testBundle) {
99 t.Helper()
100
101 var (
102 dbPool = riversharedtest.DBPool(ctx, t)
103 driver = riverpgxv5.New(dbPool)
104 schema = riverdbtest.TestSchema(ctx, t, driver, nil)
105 config = newTestConfig(t, schema)
106 pluginDriver = newDriverWithPlugin(t, dbPool)
107 pluginPilot = newPilotWithPlugin(t)
108 )
109 pluginDriver.pilot = pluginPilot
110
111 client, err := NewClient(pluginDriver, config)
112 require.NoError(t, err)
113
114 return client, &testBundle{
115 pluginDriver: pluginDriver,
116 pluginPilot: pluginPilot,
117 }
118 }
119
120 t.Run("ServicesStart", func(t *testing.T) {
121 t.Parallel()
122
123 client, bundle := setup(t)
124
125 startClient(ctx, t, client)
126
127 riversharedtest.WaitOrTimeout(t, startstop.WaitAllStartedC(
128 bundle.pluginPilot.maintenanceService,
129 bundle.pluginPilot.service,
130 ))
131 })
132}
133
134var _ pilotPlugin = &TestPilotWithPlugin{}
135

Callers

nothing calls this directly

Calls 12

DBPoolFunction · 0.92
NewFunction · 0.92
TestSchemaFunction · 0.92
WaitOrTimeoutFunction · 0.92
WaitAllStartedCFunction · 0.92
newDriverWithPluginFunction · 0.85
newPilotWithPluginFunction · 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…