diff --git a/pkg/util.go b/pkg/util.go index aea5b4c16..b250375be 100755 --- a/pkg/util.go +++ b/pkg/util.go @@ -11,7 +11,6 @@ import ( "os" "path/filepath" "strconv" - "regexp" "strings" "time" @@ -233,20 +232,11 @@ func ReadSessionIndices(path string, Logger *zap.Logger) ([]string, error) { } for _, v := range files { - // Define the regular expression pattern - pattern := fmt.Sprintf(`^%s\d{1,}$`, models.TestSetPattern) - - // Compile the regular expression - regex, err := regexp.Compile(pattern) - if err != nil { - return indices, err - } - - // Check if the string matches the pattern - if regex.MatchString(v.Name()) { + if v.Name() != "testReports" { indices = append(indices, v.Name()) } } + return indices, nil } @@ -255,7 +245,7 @@ func DeleteTestReports(logger *zap.Logger, generateTestReport bool) { if generateTestReport { return } - + _, err := os.Stat("keploy/testReports") if os.IsNotExist(err) { return @@ -267,4 +257,4 @@ func DeleteTestReports(logger *zap.Logger, generateTestReport bool) { } logger.Info("Test Reports are being removed since generateTestReport flag is set false") -} \ No newline at end of file +}