globScripts returns the test script files matching pattern, sorted for a deterministic order (so sharding is stable across runners). The testrunner dir is skipped: it holds the generic testscript used for projects in the examples/ directory, which is run separately (see RunDevboxTestscripts).
(pattern string)
| 57 | // dir is skipped: it holds the generic testscript used for projects in the |
| 58 | // examples/ directory, which is run separately (see RunDevboxTestscripts). |
| 59 | func globScripts(pattern string) []string { |
| 60 | scripts, err := doublestar.FilepathGlob(pattern) |
| 61 | if err != nil { |
| 62 | return nil |
| 63 | } |
| 64 | |
| 65 | filtered := scripts[:0] |
| 66 | for _, script := range scripts { |
| 67 | if filepath.Base(filepath.Dir(script)) == "testrunner" { |
| 68 | continue |
| 69 | } |
| 70 | filtered = append(filtered, script) |
| 71 | } |
| 72 | sort.Strings(filtered) |
| 73 | return filtered |
| 74 | } |
| 75 | |
| 76 | // shard partitions the test scripts across CI runners. The testscripts are |
| 77 | // bound by per-runner nix work (downloading package closures and evaluating |