Skip to content

Commit 00d8324

Browse files
committed
Added a test of using the default EPP configuration
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
1 parent 95d4d13 commit 00d8324

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

pkg/epp/config/loader/configloader_test.go

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ import (
4343
framework "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/framework/interface/scheduling"
4444
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/framework/plugins/scheduling/picker"
4545
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/framework/plugins/scheduling/profile"
46+
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/framework/plugins/scheduling/scorer"
47+
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/framework/plugins/scheduling/scorer/prefix"
4648
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/saturationdetector/framework/plugins/utilizationdetector"
4749
"sigs.k8s.io/gateway-api-inference-extension/test/utils"
4850
)
@@ -67,6 +69,10 @@ func TestLoadRawConfiguration(t *testing.T) {
6769
RegisterFeatureGate(datalayer.ExperimentalDatalayerFeatureGate)
6870
RegisterFeatureGate(flowcontrol.FeatureGate)
6971

72+
queueScorerWeight := 2.0
73+
kvCacheUtilizationScorerWeight := 2.0
74+
prefixCacheScorerWeight := 3.0
75+
7076
tests := []struct {
7177
name string
7278
configText string
@@ -124,6 +130,51 @@ func TestLoadRawConfiguration(t *testing.T) {
124130
},
125131
wantErr: false,
126132
},
133+
{
134+
name: "Success - Default configuration",
135+
configText: "",
136+
want: &configapi.EndpointPickerConfig{
137+
TypeMeta: metav1.TypeMeta{
138+
APIVersion: "inference.networking.x-k8s.io/v1alpha1",
139+
Kind: "EndpointPickerConfig",
140+
},
141+
FeatureGates: configapi.FeatureGates{},
142+
Plugins: []configapi.PluginSpec{
143+
{
144+
Name: scorer.QueueScorerType,
145+
Type: scorer.QueueScorerType,
146+
},
147+
{
148+
Name: scorer.KvCacheUtilizationScorerType,
149+
Type: scorer.KvCacheUtilizationScorerType,
150+
},
151+
{
152+
Name: prefix.PrefixCachePluginType,
153+
Type: prefix.PrefixCachePluginType,
154+
},
155+
},
156+
SchedulingProfiles: []configapi.SchedulingProfile{
157+
{
158+
Name: "default",
159+
Plugins: []configapi.SchedulingPlugin{
160+
{
161+
PluginRef: scorer.QueueScorerType,
162+
Weight: &queueScorerWeight,
163+
},
164+
{
165+
PluginRef: scorer.KvCacheUtilizationScorerType,
166+
Weight: &kvCacheUtilizationScorerWeight,
167+
},
168+
{
169+
PluginRef: prefix.PrefixCachePluginType,
170+
Weight: &prefixCacheScorerWeight,
171+
},
172+
},
173+
},
174+
},
175+
},
176+
wantErr: false,
177+
},
127178
{
128179
name: "Error - Invalid YAML",
129180
configText: errorBadYamlText,

0 commit comments

Comments
 (0)