From ca422cd1e9c8cbf540cdae8c9bdb5a0cdc3c16f7 Mon Sep 17 00:00:00 2001 From: Artur Sawicki Date: Tue, 12 Dec 2023 12:39:06 +0100 Subject: [PATCH] Fix tests --- pkg/resources/external_oauth_integration.go | 4 ++-- pkg/resources/user_public_keys_acceptance_test.go | 10 ++++++---- pkg/resources/warehouse.go | 2 +- pkg/resources/warehouse_acceptance_test.go | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/pkg/resources/external_oauth_integration.go b/pkg/resources/external_oauth_integration.go index 8df3c5c993..db1250d876 100644 --- a/pkg/resources/external_oauth_integration.go +++ b/pkg/resources/external_oauth_integration.go @@ -217,7 +217,7 @@ func CreateExternalOauthIntegration(d *schema.ResourceData, meta interface{}) er d.SetId(ExternalOauthIntegrationID(&input.ExternalOauthIntegration3)) - return nil + return ReadExternalOauthIntegration(d, meta) } // ReadExternalOauthIntegration implements schema.ReadFunc. @@ -543,7 +543,7 @@ func UpdateExternalOauthIntegration(d *schema.ResourceData, meta interface{}) er } } - return nil + return ReadExternalOauthIntegration(d, meta) } // DeleteExternalOauthIntegration implements schema.DeleteFunc. diff --git a/pkg/resources/user_public_keys_acceptance_test.go b/pkg/resources/user_public_keys_acceptance_test.go index f9eb0eb93b..ec49961551 100644 --- a/pkg/resources/user_public_keys_acceptance_test.go +++ b/pkg/resources/user_public_keys_acceptance_test.go @@ -37,14 +37,16 @@ func TestAcc_UserPublicKeys(t *testing.T) { resource.TestCheckResourceAttr("snowflake_user_public_keys.foobar", "rsa_public_key", sshkey1), resource.TestCheckResourceAttr("snowflake_user_public_keys.foobar", "rsa_public_key_2", sshkey2), + resource.TestCheckNoResourceAttr("snowflake_user_public_keys.foobar", "has_rsa_public_key"), ), }, // IMPORT { - ResourceName: "snowflake_user.w", - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"password", "rsa_public_key", "rsa_public_key_2", "must_change_password"}, + ResourceName: "snowflake_user.w", + ImportState: true, + ImportStateVerify: true, + // Ignoring because keys are currently altered outside of snowflake_user resource (in snowflake_user_public_keys). + ImportStateVerifyIgnore: []string{"password", "rsa_public_key", "rsa_public_key_2", "has_rsa_public_key", "must_change_password"}, }, }, }) diff --git a/pkg/resources/warehouse.go b/pkg/resources/warehouse.go index f27fb75c05..2c7e053899 100644 --- a/pkg/resources/warehouse.go +++ b/pkg/resources/warehouse.go @@ -419,7 +419,7 @@ func UpdateWarehouse(d *schema.ResourceData, meta interface{}) error { } } - return nil + return ReadWarehouse(d, meta) } // DeleteWarehouse implements schema.DeleteFunc. diff --git a/pkg/resources/warehouse_acceptance_test.go b/pkg/resources/warehouse_acceptance_test.go index 389242052f..48eb3e5ead 100644 --- a/pkg/resources/warehouse_acceptance_test.go +++ b/pkg/resources/warehouse_acceptance_test.go @@ -50,7 +50,7 @@ func TestAcc_Warehouse(t *testing.T) { resource.TestCheckResourceAttr("snowflake_warehouse.w", "name", prefix2), resource.TestCheckResourceAttr("snowflake_warehouse.w", "comment", "test comment 2"), resource.TestCheckResourceAttr("snowflake_warehouse.w", "auto_suspend", "60"), - resource.TestCheckResourceAttr("snowflake_warehouse.w", "warehouse_size", "X-LARGE"), + resource.TestCheckResourceAttr("snowflake_warehouse.w", "warehouse_size", "XLARGE"), ), }, // IMPORT