(t *testing.T)
| 86 | } |
| 87 | |
| 88 | func 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 | |
| 134 | var _ pilotPlugin = &TestPilotWithPlugin{} |
| 135 |
nothing calls this directly
no test coverage detected
searching dependent graphs…