ci: skip flakey darwin tests on PR runs (#4749)

Some care has been taken that these tests still run on development
machines. They'll only be skipped if the following is true:

1. the os is darwin
2. the GITHUB_ACTIONS env var is set to something

This approach, adding the skip calls manually on a case-by-case basis,
should allow us some fine-grained control. If we had used build tags,
we'd only be able to skip all the tests in one file together.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
This commit is contained in:
Stephan Renatus
2022-06-07 14:38:30 +02:00
committed by GitHub
parent 68653fc825
commit 927f631472
4 changed files with 29 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
//go:build !darwin
// +build !darwin
package test
import "testing"
// Skip will skip this test on pull request CI runs.
// Used for slow test runners on GHA's darwin machines.
func Skip(*testing.T) {}
+15
View File
@@ -0,0 +1,15 @@
package test
import (
"os"
"testing"
)
// Skip will skip this test on pull request CI runs.
// Used for slow test runners on GHA's darwin machines.
func Skip(t *testing.T) {
if os.Getenv("GITHUB_ACTIONS") == "" {
return
}
t.Skip("skipped on Darwin, test runner is slow")
}