SetupTestDir creates a directory for the current test run
()
| 503 | |
| 504 | // SetupTestDir creates a directory for the current test run |
| 505 | func (h *Harness) SetupTestDir() string { |
| 506 | dir := filepath.Join(h.RootDir, "e2e", "runs", h.t.Name()) |
| 507 | // Clean up previous run |
| 508 | os.RemoveAll(dir) |
| 509 | if err := os.MkdirAll(dir, 0755); err != nil { |
| 510 | h.t.Fatal(err) |
| 511 | } |
| 512 | return dir |
| 513 | } |
| 514 | |
| 515 | // WriteConfig marshals the config to YAML and writes it to the specified directory with the given filename |
| 516 | func (h *Harness) WriteConfig(dir, filename string, cfg any) string { |