MCPcopy
hub / github.com/docker/docker-agent / startRecordingAIProxy

Function startRecordingAIProxy

e2e/proxy_test.go:17–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

15)
16
17func 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
50type testEnvProvider map[string]string
51

Callers 10

runCLIFunction · 0.85
TestMCP_SingleAgentFunction · 0.85
TestMCP_MultiAgentFunction · 0.85
TestRuntime_OpenAI_BasicFunction · 0.85
TestA2AServer_AgentCardFunction · 0.85
TestA2AServer_InvokeFunction · 0.85
TestA2AServer_MultiAgentFunction · 0.85

Calls 5

DefaultMatcherFunction · 0.92
StartProxyWithOptionsFunction · 0.92
ContextMethod · 0.80
NameMethod · 0.65
CleanupMethod · 0.65

Tested by

no test coverage detected