@@ -450,65 +450,16 @@ func modifiedPackages(changedFiles []string, version provider.Version) (map[stri
450450 return services , runFullVCR
451451}
452452
453- func allSubFolders (root string ) (map [string ]struct {}, error ) {
454- subfolders := make (map [string ]struct {})
455- entries , err := os .ReadDir (root )
456- if err != nil {
457- return nil , fmt .Errorf ("failed to read directory '%s': %w" , root , err )
458- }
459-
460- for _ , entry := range entries {
461- if entry .IsDir () {
462- subfolders [entry .Name ()] = struct {}{}
463- }
464- }
465- return subfolders , nil
466- }
467-
468453func runReplaying (runFullVCR bool , version provider.Version , services map [string ]struct {}, vt * vcr.Tester ) (vcr.Result , []string , error ) {
469454 result := vcr.Result {}
470455 var testDirs []string
471456 var replayingErr error
472457 if runFullVCR {
473458 fmt .Println ("runReplaying: full VCR tests" )
474- // result, replayingErr = vt.Run(vcr.RunOptions{
475- // Mode: vcr.Replaying,
476- // Version: version,
477- // })
478-
479- // temporary workaround
480- serviceRoot := filepath .Join (vt .GetRepoPath (version ), version .ProviderName (), "services" )
481- allServies , err := allSubFolders (serviceRoot )
482- if err != nil {
483- return result , testDirs , err
484- }
485-
486- var gkePath string
487- var otherPaths []string
488- for service := range allServies {
489- servicePath := "./" + filepath .Join (version .ProviderName (), "services" , service )
490- if service == "container" {
491- gkePath = servicePath
492- continue
493- }
494- otherPaths = append (otherPaths , servicePath )
495- }
496459 result , replayingErr = vt .Run (vcr.RunOptions {
497- Mode : vcr .Replaying ,
498- Version : version ,
499- TestDirs : otherPaths ,
500- })
501- // run gke replaying tests separately
502- gkeResult , gkeReplayingErr := vt .Run (vcr.RunOptions {
503- Mode : vcr .Replaying ,
504- Version : version ,
505- TestDirs : []string {gkePath },
460+ Mode : vcr .Replaying ,
461+ Version : version ,
506462 })
507- replayingErr = errors .Join (replayingErr , gkeReplayingErr )
508- result .PassedTests = append (result .PassedTests , gkeResult .PassedTests ... )
509- result .SkippedTests = append (result .SkippedTests , gkeResult .SkippedTests ... )
510- result .FailedTests = append (result .FailedTests , gkeResult .FailedTests ... )
511- result .Panics = append (result .Panics , gkeResult .Panics ... )
512463 } else if len (services ) > 0 {
513464 fmt .Printf ("runReplaying: %d specific services: %v\n " , len (services ), services )
514465 for service := range services {
0 commit comments