MCPcopy Create free account
hub / github.com/dolthub/doltgresql / runScripts

Function runScripts

testing/go/framework.go:364–386  ·  view source on GitHub ↗

runScripts is the implementation of both RunScripts and RunScriptsWithoutNormalization.

(t *testing.T, scripts []ScriptTest, normalizeRows bool)

Source from the content-addressed store, hash-verified

362
363// runScripts is the implementation of both RunScripts and RunScriptsWithoutNormalization.
364func runScripts(t *testing.T, scripts []ScriptTest, normalizeRows bool) {
365 // First, we'll run through the scripts to check for the Focus variable. If it's true, then append it to the new slice.
366 focusScripts := make([]ScriptTest, 0, len(scripts))
367 for _, script := range scripts {
368 if script.Focus {
369 // If this is running in GitHub Actions, then we'll panic, because someone forgot to disable it before committing
370 if _, ok := os.LookupEnv("GITHUB_ACTION"); ok {
371 panic(fmt.Sprintf("The script `%s` has Focus set to `true`. GitHub Actions requires that "+
372 "all tests are run, which Focus circumvents, leading to this error. Please disable Focus on "+
373 "all tests.", script.Name))
374 }
375 focusScripts = append(focusScripts, script)
376 }
377 }
378 // If we have scripts with Focus set, then we replace the normal script slice with the new slice.
379 if len(focusScripts) > 0 {
380 scripts = focusScripts
381 }
382
383 for _, script := range scripts {
384 RunScript(t, script, normalizeRows)
385 }
386}
387
388func ptr[T any](val T) *T {
389 return &val

Callers 2

RunScriptsFunction · 0.85

Calls 1

RunScriptFunction · 0.70

Tested by

no test coverage detected