@@ -320,6 +320,11 @@ func (o *runOption) runSuite(loader testing.Loader, dataContext map[string]inter
320320 return
321321 }
322322
323+ suiteRunner := runner .GetTestSuiteRunner (testSuite )
324+ suiteRunner .WithTestReporter (o .reporter )
325+ suiteRunner .WithSecure (testSuite .Spec .Secure )
326+ suiteRunner .WithOutputWriter (os .Stdout )
327+ suiteRunner .WithWriteLevel (o .level )
323328 for _ , testCase := range testSuite .Items {
324329 if ! testCase .InScope (o .caseItems ) {
325330 continue
@@ -338,12 +343,7 @@ func (o *runOption) runSuite(loader testing.Loader, dataContext map[string]inter
338343 ctxWithTimeout , _ := context .WithTimeout (ctx , o .requestTimeout )
339344 ctxWithTimeout = context .WithValue (ctxWithTimeout , runner .ContextKey ("" ).ParentDir (), loader .GetContext ())
340345
341- runner := runner .GetTestSuiteRunner (testSuite )
342- runner .WithTestReporter (o .reporter )
343- runner .WithSecure (testSuite .Spec .Secure )
344- runner .WithOutputWriter (os .Stdout )
345- runner .WithWriteLevel (o .level )
346- if output , err = runner .RunTestCase (& testCase , dataContext , ctxWithTimeout ); err != nil && ! o .requestIgnoreError {
346+ if output , err = suiteRunner .RunTestCase (& testCase , dataContext , ctxWithTimeout ); err != nil && ! o .requestIgnoreError {
347347 err = fmt .Errorf ("failed to run '%s', %v" , testCase .Name , err )
348348 return
349349 } else {
0 commit comments