| 36 | } |
| 37 | |
| 38 | func collectExamples(t *testing.T) []string { |
| 39 | t.Helper() |
| 40 | |
| 41 | var files []string |
| 42 | err := filepath.WalkDir(filepath.Join("..", "..", "examples"), func(path string, d fs.DirEntry, err error) error { |
| 43 | if err != nil { |
| 44 | return err |
| 45 | } |
| 46 | if !d.IsDir() && filepath.Ext(path) == ".yaml" { |
| 47 | if reason, skip := skipExamples[filepath.Base(path)]; skip { |
| 48 | t.Logf("Skipping %s: %s", path, reason) |
| 49 | return nil |
| 50 | } |
| 51 | files = append(files, path) |
| 52 | } |
| 53 | return nil |
| 54 | }) |
| 55 | require.NoError(t, err) |
| 56 | assert.NotEmpty(t, files) |
| 57 | |
| 58 | return files |
| 59 | } |
| 60 | |
| 61 | type noEnvProvider struct{} |
| 62 | |