test: add git helper and guard annotations
This commit is contained in:
committed by
Steve Yegge
parent
f3dcafca66
commit
713c569e6e
17
cmd/bd/test_guard_helpers.go
Normal file
17
cmd/bd/test_guard_helpers.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// requireTestGuardDisabled skips destructive integration tests unless the
|
||||
// BEADS_TEST_GUARD_DISABLE flag is set, mirroring the behavior enforced by the
|
||||
// guard when running the full suite.
|
||||
func requireTestGuardDisabled(t *testing.T) {
|
||||
t.Helper()
|
||||
if os.Getenv("BEADS_TEST_GUARD_DISABLE") != "" {
|
||||
return
|
||||
}
|
||||
t.Skip("set BEADS_TEST_GUARD_DISABLE=1 to run this integration test")
|
||||
}
|
||||
Reference in New Issue
Block a user