mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-09-19 06:31:47 +00:00
Convert the controllerlib tests to use the same structure as our other integration tests.
Signed-off-by: Matt Moyer <moyerm@vmware.com>
This commit is contained in:
@@ -17,10 +17,12 @@ import (
|
||||
|
||||
"github.com/suzerain-io/pinniped/internal/controllerlib/test/integration/examplecontroller/api"
|
||||
examplestart "github.com/suzerain-io/pinniped/internal/controllerlib/test/integration/examplecontroller/starter"
|
||||
"github.com/suzerain-io/pinniped/internal/controllerlib/test/library"
|
||||
"github.com/suzerain-io/pinniped/test/library"
|
||||
)
|
||||
|
||||
func TestExampleController(t *testing.T) {
|
||||
library.SkipUnlessIntegration(t)
|
||||
|
||||
config := library.NewClientConfig(t)
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 VMware, Inc.
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
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 = "CONTROLLER_GO_TEST_INTEGRATION"
|
||||
|
||||
var shouldRunIntegrationTests = func() bool {
|
||||
b, _ := strconv.ParseBool(os.Getenv(magicIntegrationTestsEnvVar))
|
||||
return b
|
||||
}()
|
||||
|
||||
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())
|
||||
}
|
||||
Reference in New Issue
Block a user