Skip to content

Commit a4afd1d

Browse files
committed
Ensure no regressions from #1958.
1 parent 6057e36 commit a4afd1d

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

pkg/epp/config/loader/configloader_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,20 @@ func TestInstantiateAndConfigure(t *testing.T) {
201201
"Defaults: SingleProfileHandler was not injected")
202202
},
203203
},
204+
{
205+
name: "Success - Picker Before Scorer",
206+
configText: successPickerBeforeScorerText,
207+
wantErr: false,
208+
validate: func(t *testing.T, _ plugins.Handle, cfg *configapi.EndpointPickerConfig) {
209+
require.Len(t, cfg.SchedulingProfiles, 1)
210+
prof := cfg.SchedulingProfiles[0]
211+
require.Equal(t, "test-picker", prof.Plugins[0].PluginRef, "Picker should be the first plugin")
212+
require.Equal(t, "test-scorer", prof.Plugins[1].PluginRef, "Scorer should be the second plugin")
213+
scorerWeight := prof.Plugins[1].Weight
214+
require.NotNil(t, scorerWeight, "Scorer weight should be set (defaulted)")
215+
require.Equal(t, 1, *scorerWeight, "Scorer weight should default to 1")
216+
},
217+
},
204218

205219
// --- Instantiation Errors ---
206220
{

pkg/epp/config/loader/testdata_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,22 @@ schedulingProfiles:
115115
- pluginRef: maxScore
116116
`
117117

118+
// successPickerBeforeScorerText tests the regression case where a Picker appears before a Scorer (without weight) in
119+
// the plugin list.
120+
const successPickerBeforeScorerText = `
121+
apiVersion: inference.networking.x-k8s.io/v1alpha1
122+
kind: EndpointPickerConfig
123+
plugins:
124+
- type: single-profile-handler
125+
- type: test-picker
126+
- type: test-scorer
127+
schedulingProfiles:
128+
- name: default
129+
plugins:
130+
- pluginRef: test-picker
131+
- pluginRef: test-scorer
132+
`
133+
118134
// --- Invalid Configurations (Syntax/Structure) ---
119135

120136
// errorBadYamlText contains invalid YAML syntax.

0 commit comments

Comments
 (0)