testing: Skip some slow tests when not running in CI

Fixes #14438
This commit is contained in:
Bjørn Erik Pedersen
2026-01-27 10:20:39 +01:00
parent b3ea2a5fab
commit 5f5b2f378f
14 changed files with 54 additions and 3 deletions
+8
View File
@@ -105,6 +105,14 @@ func DiffStrings(s1, s2 string) []string {
return DiffStringSlices(strings.Fields(s1), strings.Fields(s2))
}
// SkipSlowTestUnlessCI skips the test unless we're running in a CI server.
// Note that you can set CI_LOCAL=1 to run slow tests locally in a CI-like setup.
func SkipSlowTestUnlessCI(t testing.TB) {
if !IsCI() {
t.Skip("skipping slow test in CI")
}
}
// IsCI reports whether we're running in a CI server.
func IsCI() bool {
return (os.Getenv("CI") != "" || os.Getenv("CI_LOCAL") != "") && os.Getenv("CIRCLE_BRANCH") == ""