Files
pinniped/test/integration/main_test.go
Monis Khan 622d488fc3 Add integration test stub
Signed-off-by: Monis Khan <mok@vmware.com>
2020-07-07 22:59:00 -04:00

29 lines
680 B
Go

package integration
import (
"fmt"
"os"
"strconv"
"testing"
)
// force users to opt-in to running the integration tests
// this prevents them from running if someone does `go test ./...`
// these tests could be destructive to the cluster under test
const magicIntegrationTestsEnvVar = "NAME_TEST_INTEGRATION"
var shouldRunIntegrationTests bool
func init() {
shouldRunIntegrationTests, _ = strconv.ParseBool(os.Getenv(magicIntegrationTestsEnvVar))
}
func TestMain(m *testing.M) {
if !shouldRunIntegrationTests {
fmt.Printf("SKIP: %s=true env var must be explicitly set for integration tests to run\n", magicIntegrationTestsEnvVar)
os.Exit(0)
}
os.Exit(m.Run())
}