From dfadb965b7014618848afe706d7916c3b3519495 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Tue, 18 Oct 2022 14:45:18 +0200 Subject: [PATCH] Use short test to signal that we dont run integration Signed-off-by: Kristoffer Dalby --- Makefile | 2 +- integration_cli_test.go | 4 ++++ integration_embedded_derp_test.go | 4 ++++ integration_general_test.go | 4 ++++ integration_oidc_test.go | 4 ++++ 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 90ee5107..c5a2d88c 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ build: dev: lint test build test: - @go test -coverprofile=coverage.out ./... + @go test -short -coverprofile=coverage.out ./... test_integration: test_integration_cli test_integration_derp test_integration_oidc test_integration_general diff --git a/integration_cli_test.go b/integration_cli_test.go index dc854034..06771483 100644 --- a/integration_cli_test.go +++ b/integration_cli_test.go @@ -27,6 +27,10 @@ type IntegrationCLITestSuite struct { } func TestIntegrationCLITestSuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping integration tests due to short flag") + } + s := new(IntegrationCLITestSuite) suite.Run(t, s) diff --git a/integration_embedded_derp_test.go b/integration_embedded_derp_test.go index 343a04ad..0b7a8d27 100644 --- a/integration_embedded_derp_test.go +++ b/integration_embedded_derp_test.go @@ -45,6 +45,10 @@ type IntegrationDERPTestSuite struct { } func TestIntegrationDERPTestSuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping integration tests due to short flag") + } + saveLogs, err := GetEnvBool("HEADSCALE_INTEGRATION_SAVE_LOG") if err != nil { saveLogs = false diff --git a/integration_general_test.go b/integration_general_test.go index 8f318d32..ad92a2b2 100644 --- a/integration_general_test.go +++ b/integration_general_test.go @@ -40,6 +40,10 @@ type IntegrationTestSuite struct { } func TestIntegrationGeneralTestSuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping integration tests due to short flag") + } + saveLogs, err := GetEnvBool("HEADSCALE_INTEGRATION_SAVE_LOG") if err != nil { saveLogs = false diff --git a/integration_oidc_test.go b/integration_oidc_test.go index 8e5f7910..2f4d7ddf 100644 --- a/integration_oidc_test.go +++ b/integration_oidc_test.go @@ -44,6 +44,10 @@ type IntegrationOIDCTestSuite struct { } func TestIntegrationOIDCTestSuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping integration tests due to short flag") + } + saveLogs, err := GetEnvBool("HEADSCALE_INTEGRATION_SAVE_LOG") if err != nil { saveLogs = false