Skip to content

Commit a46be02

Browse files
committed
Changes to tests due to changes in internal APIs
Signed-off-by: Shmuel Kallner <[email protected]>
1 parent 6a2ea60 commit a46be02

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

pkg/epp/common/config/loader/configloader_test.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,12 @@ func TestLoadConfiguration(t *testing.T) {
205205
}
206206

207207
func TestLoadPluginReferences(t *testing.T) {
208+
ctx := context.Background()
208209
theConfig, err := LoadConfig([]byte(successConfigText), "")
209210
if err != nil {
210211
t.Fatalf("LoadConfig returned unexpected error: %v", err)
211212
}
212-
handle := utils.NewTestHandle()
213+
handle := utils.NewTestHandle(ctx)
213214
err = LoadPluginReferences(theConfig.Plugins, handle)
214215
if err != nil {
215216
t.Fatalf("LoadPluginReferences returned unexpected error: %v", err)
@@ -227,15 +228,15 @@ func TestLoadPluginReferences(t *testing.T) {
227228
if err != nil {
228229
t.Fatalf("LoadConfig returned unexpected error: %v", err)
229230
}
230-
err = LoadPluginReferences(theConfig.Plugins, utils.NewTestHandle())
231+
err = LoadPluginReferences(theConfig.Plugins, utils.NewTestHandle(ctx))
231232
if err == nil {
232233
t.Fatalf("LoadPluginReferences did not return the expected error")
233234
}
234235
}
235236

236237
func TestInstantiatePlugin(t *testing.T) {
237238
plugSpec := configapi.PluginSpec{Type: "plover"}
238-
_, err := instantiatePlugin(plugSpec, utils.NewTestHandle())
239+
_, err := instantiatePlugin(plugSpec, utils.NewTestHandle(context.Background()))
239240
if err == nil {
240241
t.Fatalf("InstantiatePlugin did not return the expected error")
241242
}
@@ -286,6 +287,8 @@ func TestLoadSchedulerConfig(t *testing.T) {
286287

287288
registerNeededPlgugins()
288289

290+
ctx := context.Background()
291+
289292
for _, test := range tests {
290293
theConfig, err := LoadConfig([]byte(test.configText), "")
291294
if err != nil {
@@ -294,7 +297,7 @@ func TestLoadSchedulerConfig(t *testing.T) {
294297
}
295298
t.Fatalf("LoadConfig returned unexpected error: %v", err)
296299
}
297-
handle := utils.NewTestHandle()
300+
handle := utils.NewTestHandle(ctx)
298301
err = LoadPluginReferences(theConfig.Plugins, handle)
299302
if err != nil {
300303
if test.wantErr {

pkg/epp/scheduling/framework/plugins/filter/filter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ func TestDecisionTreeFilterFactory(t *testing.T) {
406406

407407
kvCacheScorer := scorer.NewKVCacheScorer()
408408

409-
testHandle := utils.NewTestHandle()
409+
testHandle := utils.NewTestHandle(context.Background())
410410

411411
testHandle.Plugins().AddPlugin("leastKvCache", leastKvCacheFilter)
412412
testHandle.Plugins().AddPlugin("leastQueue", leastQueueFilter)

0 commit comments

Comments
 (0)