mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
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:
@@ -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) {}
|
||||
@@ -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")
|
||||
}
|
||||
Reference in New Issue
Block a user