MCPcopy Index your code
hub / github.com/jetify-com/devbox / RunTestscripts

Function RunTestscripts

testscripts/testrunner/testrunner.go:32–53  ·  view source on GitHub ↗
(t *testing.T, testscriptsDir string)

Source from the content-addressed store, hash-verified

30}
31
32func RunTestscripts(t *testing.T, testscriptsDir string) {
33 globPattern := filepath.Join(testscriptsDir, "**/*.test.txt")
34 scripts := globScripts(globPattern)
35 require.NotEmpty(t, scripts, "no test scripts found")
36
37 shard := shardFromEnv(t)
38
39 // Run each test script (a file ending in .test.txt) in its own
40 // testscript.Run call so that we can shard at the granularity of an
41 // individual script. The scripts still run as parallel subtests.
42 for i, script := range scripts {
43 if !shard.includes(i) {
44 continue
45 }
46 params := getTestscriptParams(filepath.Dir(script))
47 // Pass the single script explicitly rather than its directory so that
48 // sharding partitions scripts, not whole directories.
49 params.Dir = ""
50 params.Files = []string{script}
51 testscript.Run(t, params)
52 }
53}
54
55// globScripts returns the test script files matching pattern, sorted for a
56// deterministic order (so sharding is stable across runners). The testrunner

Callers 1

TestScriptsFunction · 0.92

Calls 5

globScriptsFunction · 0.85
shardFromEnvFunction · 0.85
getTestscriptParamsFunction · 0.85
includesMethod · 0.80
RunMethod · 0.65

Tested by 1

TestScriptsFunction · 0.74