@@ -652,27 +652,27 @@ func TestDirector_HandleRequest(t *testing.T) {
652652 }
653653
654654 for _ , test := range tests {
655- t .Run (test .name , func (t * testing.T ) {
656- mockSched := & mockScheduler {}
657- if test .schedulerMockSetup != nil {
658- test .schedulerMockSetup (mockSched )
659- }
660- config := NewConfig ()
661- if test .prepareDataPlugin != nil {
662- config = config .WithPrepareDataPlugins (test .prepareDataPlugin )
663- }
664- config = config .WithAdmissionPlugins (newMockAdmissionPlugin ("test-admit-plugin" , test .admitRequestDenialError ))
665-
666- locator := NewCachedPodLocator (context .Background (), NewDatastorePodLocator (ds ), time .Minute )
667- director := NewDirectorWithConfig (ds , mockSched , test .mockAdmissionController , locator , config )
668- if test .name == "successful request with model rewrite" {
669- mockDs := & mockDatastore {
670- pods : ds .PodList (datastore .AllPodsPredicate ),
671- rewrites : []* v1alpha2.InferenceModelRewrite {rewrite },
672- }
673- director .datastore = mockDs
674- director .podLocator = NewCachedPodLocator (context .Background (), NewDatastorePodLocator (mockDs ), time .Minute )
675- }
655+ t .Run (test .name , func (t * testing.T ) {
656+ mockSched := & mockScheduler {}
657+ if test .schedulerMockSetup != nil {
658+ test .schedulerMockSetup (mockSched )
659+ }
660+ config := NewConfig ()
661+ if test .prepareDataPlugin != nil {
662+ config = config .WithPrepareDataPlugins (test .prepareDataPlugin )
663+ }
664+ config = config .WithAdmissionPlugins (newMockAdmissionPlugin ("test-admit-plugin" , test .admitRequestDenialError ))
665+
666+ locator := NewCachedPodLocator (context .Background (), NewDatastorePodLocator (ds ), time .Minute )
667+ director := NewDirectorWithConfig (ds , mockSched , test .mockAdmissionController , locator , config )
668+ if test .name == "successful request with model rewrite" {
669+ mockDs := & mockDatastore {
670+ pods : ds .PodList (datastore .AllPodsPredicate ),
671+ rewrites : []* v1alpha2.InferenceModelRewrite {rewrite },
672+ }
673+ director .datastore = mockDs
674+ director .podLocator = NewCachedPodLocator (context .Background (), NewDatastorePodLocator (mockDs ), time .Minute )
675+ }
676676 reqCtx := & handlers.RequestContext {
677677 Request : & handlers.Request {
678678 // Create a copy of the map for each test run to avoid mutation issues.
0 commit comments