From 1526af745547924377d111631e0345ec504b813d Mon Sep 17 00:00:00 2001 From: Artur Sawicki Date: Wed, 27 Nov 2024 11:24:11 +0100 Subject: [PATCH] Fix tests --- Makefile | 2 +- pkg/sdk/config_test.go | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 66435284af..fa1448adef 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ sweep: ## destroy the whole architecture; USE ONLY FOR DEVELOPMENT ACCOUNTS @echo "Are you sure? [y/n]" >&2 @read -r REPLY; \ if echo "$$REPLY" | grep -qG "^[yY]$$"; then \ - TEST_SF_TF_ENABLE_SWEEP=1 go test -timeout 300s -run "^(TestSweepAll|Test_Sweeper_NukeStaleObjects)" ./pkg/sdk -v; \ + TEST_SF_TF_ENABLE_SWEEP=1 go test -timeout=10m -run "^(TestSweepAll|Test_Sweeper_NukeStaleObjects)" ./pkg/sdk -v; \ else echo "Aborting..."; \ fi; diff --git a/pkg/sdk/config_test.go b/pkg/sdk/config_test.go index 8572d1fe60..30f2b0b3c3 100644 --- a/pkg/sdk/config_test.go +++ b/pkg/sdk/config_test.go @@ -186,7 +186,7 @@ func Test_MergeConfig(t *testing.T) { Protocol: "protocol1", Host: "host1", Port: 1, - Authenticator: 1, + Authenticator: gosnowflake.AuthTypeSnowflake, Passcode: "passcode1", PasscodeInPassword: false, OktaURL: oktaUrl1, @@ -226,7 +226,7 @@ func Test_MergeConfig(t *testing.T) { Protocol: "protocol2", Host: "host2", Port: 2, - Authenticator: 2, + Authenticator: gosnowflake.AuthTypeOAuth, Passcode: "passcode2", PasscodeInPassword: true, OktaURL: oktaUrl2, @@ -268,6 +268,14 @@ func Test_MergeConfig(t *testing.T) { config := MergeConfig(config1, config2) require.Equal(t, config1, config) }) + + t.Run("special authenticator value", func(t *testing.T) { + config := MergeConfig(&gosnowflake.Config{ + Authenticator: gosnowflakeAuthTypeEmpty, + }, config1) + + require.Equal(t, config1, config) + }) } func Test_ToAuthenticationType(t *testing.T) {