Use Go's -short flag as a way to avoid running integration tests.

Signed-off-by: Matt Moyer <moyerm@vmware.com>
This commit is contained in:
Matt Moyer
2020-08-06 20:44:14 -05:00
parent c4bbb64622
commit 6dd331b21d
10 changed files with 45 additions and 1 deletions
+2
View File
@@ -15,6 +15,8 @@ import (
)
func TestGetAPIResourceList(t *testing.T) {
library.SkipUnlessIntegration(t)
client := library.NewPlaceholderNameClientset(t)
groups, resources, err := client.Discovery().ServerGroupsAndResources()
+1
View File
@@ -53,6 +53,7 @@ O2D8LtWhMbrYy755Fgq4H9s3vCgfvHY1AQ==
)
func TestClient(t *testing.T) {
library.SkipUnlessIntegration(t)
tmcClusterToken := library.Getenv(t, "PLACEHOLDER_NAME_TMC_CLUSTER_TOKEN")
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
+1
View File
@@ -19,6 +19,7 @@ import (
)
func TestGetDeployment(t *testing.T) {
library.SkipUnlessIntegration(t)
namespaceName := library.Getenv(t, "PLACEHOLDER_NAME_NAMESPACE")
deploymentName := library.Getenv(t, "PLACEHOLDER_NAME_DEPLOYMENT")
+3
View File
@@ -11,9 +11,12 @@ import (
"testing"
"github.com/stretchr/testify/require"
"github.com/suzerain-io/placeholder-name/test/library"
)
func TestGetNodes(t *testing.T) {
library.SkipUnlessIntegration(t)
cmd := exec.Command("kubectl", "get", "nodes")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
@@ -20,6 +20,7 @@ import (
)
func TestSuccessfulLoginDiscoveryConfig(t *testing.T) {
library.SkipUnlessIntegration(t)
namespaceName := library.Getenv(t, "PLACEHOLDER_NAME_NAMESPACE")
client := library.NewPlaceholderNameClientset(t)
@@ -39,6 +40,7 @@ func TestSuccessfulLoginDiscoveryConfig(t *testing.T) {
}
func TestReconcilingLoginDiscoveryConfig(t *testing.T) {
library.SkipUnlessIntegration(t)
namespaceName := library.Getenv(t, "PLACEHOLDER_NAME_NAMESPACE")
client := library.NewPlaceholderNameClientset(t)
+3
View File
@@ -57,6 +57,7 @@ func addTestClusterRoleBinding(ctx context.Context, t *testing.T, adminClient ku
}
func TestSuccessfulLoginRequest(t *testing.T) {
library.SkipUnlessIntegration(t)
tmcClusterToken := library.Getenv(t, "PLACEHOLDER_NAME_TMC_CLUSTER_TOKEN")
response, err := makeRequest(t, v1alpha1.LoginRequestSpec{
@@ -146,6 +147,7 @@ func TestSuccessfulLoginRequest(t *testing.T) {
}
func TestFailedLoginRequestWhenTheRequestIsValidButTheTokenDoesNotAuthenticateTheUser(t *testing.T) {
library.SkipUnlessIntegration(t)
response, err := makeRequest(t, v1alpha1.LoginRequestSpec{
Type: v1alpha1.TokenLoginCredentialType,
Token: &v1alpha1.LoginRequestTokenCredential{Value: "not a good token"},
@@ -160,6 +162,7 @@ func TestFailedLoginRequestWhenTheRequestIsValidButTheTokenDoesNotAuthenticateTh
}
func TestLoginRequest_ShouldFailWhenRequestDoesNotIncludeToken(t *testing.T) {
library.SkipUnlessIntegration(t)
response, err := makeRequest(t, v1alpha1.LoginRequestSpec{
Type: v1alpha1.TokenLoginCredentialType,
Token: nil,