MCPcopy Index your code
hub / github.com/docker/docker-agent / TestCreateJudgeModelKnownProvider

Function TestCreateJudgeModelKnownProvider

pkg/evaluation/judge_model_test.go:18–42  ·  view source on GitHub ↗

TestCreateJudgeModelKnownProvider reproduces issue #3219: creating the eval judge model failed with `unknown provider type "anthropic"` because the judge was built through the empty package-level default registry instead of the fully-populated provider registry.

(t *testing.T)

Source from the content-addressed store, hash-verified

16// was built through the empty package-level default registry instead of the
17// fully-populated provider registry.
18func TestCreateJudgeModelKnownProvider(t *testing.T) {
19 t.Parallel()
20
21 runConfig := &config.RuntimeConfig{
22 EnvProviderForTests: environment.NewMapEnvProvider(map[string]string{
23 "ANTHROPIC_API_KEY": "test-key",
24 "OPENAI_API_KEY": "test-key",
25 "GOOGLE_API_KEY": "test-key",
26 }),
27 // Mirror how the eval command wires the full provider set; the package
28 // default registry is empty (see pkg/model/provider/providers).
29 ProviderRegistry: providers.NewDefaultRegistry(),
30 }
31
32 for _, judgeModel := range []string{
33 "anthropic/claude-opus-4-5-20251101", // the default judge model that triggered #3219
34 "anthropic/claude-sonnet-4-0",
35 "openai/gpt-5",
36 "google/gemini-2.5-flash",
37 } {
38 judge, err := createJudgeModel(t.Context(), judgeModel, runConfig)
39 require.NoError(t, err, "judge model %q should resolve to a known provider", judgeModel)
40 assert.NotNil(t, judge)
41 }
42}

Callers

nothing calls this directly

Calls 4

NewMapEnvProviderFunction · 0.92
NewDefaultRegistryFunction · 0.92
createJudgeModelFunction · 0.85
ContextMethod · 0.80

Tested by

no test coverage detected