findResultFiles finds all agent test result files in the directory
(dir string)
| 160 | |
| 161 | // findResultFiles finds all agent test result files in the directory |
| 162 | func findResultFiles(dir string) ([]string, error) { |
| 163 | var files []string |
| 164 | pattern := regexp.MustCompile(`.*_agent_test_results_.*\.json$`) |
| 165 | |
| 166 | err := filepath.WalkDir(dir, func(path string, d fs.DirEntry, err error) error { |
| 167 | if err != nil { |
| 168 | return err |
| 169 | } |
| 170 | if !d.IsDir() && pattern.MatchString(d.Name()) { |
| 171 | files = append(files, path) |
| 172 | } |
| 173 | return nil |
| 174 | }) |
| 175 | |
| 176 | return files, err |
| 177 | } |
| 178 | |
| 179 | // groupFilesByModel groups result files by model name |
| 180 | func groupFilesByModel(files []string) map[string][]string { |