(t *testing.T)
| 15 | ) |
| 16 | |
| 17 | func startRecordingAIProxy(t *testing.T) (*httptest.Server, *config.RuntimeConfig) { |
| 18 | t.Helper() |
| 19 | |
| 20 | cassettePath := filepath.Join("testdata", "cassettes", t.Name()) |
| 21 | |
| 22 | // Create a matcher that fails the test on error |
| 23 | matcher := fake.DefaultMatcher(func(err error) { |
| 24 | require.NoError(t, err) |
| 25 | }) |
| 26 | |
| 27 | proxyURL, cleanup, err := fake.StartProxyWithOptions(t.Context(), |
| 28 | cassettePath, |
| 29 | recorder.ModeRecordOnce, |
| 30 | matcher, |
| 31 | fake.APIKeyHeaderUpdater, |
| 32 | nil, |
| 33 | ) |
| 34 | require.NoError(t, err) |
| 35 | |
| 36 | t.Cleanup(func() { |
| 37 | require.NoError(t, cleanup()) |
| 38 | }) |
| 39 | |
| 40 | return &httptest.Server{URL: proxyURL}, &config.RuntimeConfig{ |
| 41 | Config: config.Config{ |
| 42 | ModelsGateway: proxyURL, |
| 43 | }, |
| 44 | EnvProviderForTests: &testEnvProvider{ |
| 45 | environment.DockerDesktopTokenEnv: "DUMMY", |
| 46 | }, |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | type testEnvProvider map[string]string |
| 51 |
no test coverage detected