From 3f764648332c65f8a00d857deaed97b633f4f9dc Mon Sep 17 00:00:00 2001 From: Jakub Michalak Date: Thu, 7 Nov 2024 15:54:15 +0100 Subject: [PATCH 01/10] Unskip auth tests --- .github/workflows/tests.yml | 4 ++++ pkg/acceptance/testing.go | 21 ++++++++++++++++ pkg/provider/provider_acceptance_test.go | 24 +------------------ pkg/resources/account_role_acceptance_test.go | 4 ++++ pkg/resources/alert_acceptance_test.go | 4 +++- ...uthorization_code_grant_acceptance_test.go | 4 ++++ ...with_client_credentials_acceptance_test.go | 4 ++++ ...gration_with_jwt_bearer_acceptance_test.go | 4 ++++ pkg/resources/database_acceptance_test.go | 8 +++++++ .../database_role_acceptance_test.go | 4 ++++ .../external_function_acceptance_test.go | 9 +++++++ ...ernal_oauth_integration_acceptance_test.go | 8 +++++++ pkg/resources/function_acceptance_test.go | 5 ++++ .../grant_account_role_acceptance_test.go | 4 ++++ .../grant_application_role_acceptance_test.go | 4 ++++ .../grant_database_role_acceptance_test.go | 4 ++++ .../grant_ownership_acceptance_test.go | 4 ++++ ...vileges_to_account_role_acceptance_test.go | 6 +++++ ...ileges_to_database_role_acceptance_test.go | 6 +++++ ...ant_privileges_to_share_acceptance_test.go | 4 ++++ .../masking_policy_acceptance_test.go | 4 ++++ .../network_policy_acceptance_test.go | 6 +++++ pkg/resources/network_rule_acceptance_test.go | 2 ++ ...otification_integration_acceptance_test.go | 4 ++++ ...tion_for_custom_clients_acceptance_test.go | 4 ++++ ...or_partner_applications_acceptance_test.go | 4 ++++ .../password_policy_acceptance_test.go | 2 ++ pkg/resources/procedure_acceptance_test.go | 11 +++++++++ .../resource_monitor_acceptance_test.go | 10 ++++++++ .../row_access_policy_acceptance_test.go | 6 +++++ .../saml2_integration_acceptance_test.go | 4 ++++ pkg/resources/schema_acceptance_test.go | 11 +++++++++ .../scim_integration_acceptance_test.go | 10 ++++++++ .../secondary_database_acceptance_test.go | 4 ++++ .../shared_database_acceptance_test.go | 4 ++++ pkg/resources/streamlit_acceptance_test.go | 4 ++++ pkg/resources/table_acceptance_test.go | 4 ++++ .../table_constraint_acceptance_test.go | 4 ++++ pkg/resources/user_acceptance_test.go | 4 ++++ pkg/resources/view_acceptance_test.go | 2 ++ pkg/resources/warehouse_acceptance_test.go | 22 +++++++++++++++++ 41 files changed, 237 insertions(+), 24 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f994b9b86d..b1afa8a6e7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -43,6 +43,10 @@ jobs: id: create_config run: mkdir $HOME/.snowflake && echo "${{ secrets.SNOWFLAKE_CONFIG_FILE }}" > $HOME/.snowflake/config + - name: Create and populate .snowflake/config_v097_compatible file + id: create_config_v097_compatible + run: mkdir $HOME/.snowflake && echo "${{ secrets.SNOWFLAKE_CONFIG_FILE_V097_COMPATIBLE }}" > $HOME/.snowflake/config_v097_compatible + - run: make test if: ${{ !cancelled() && steps.create_config.conclusion == 'success' }} env: diff --git a/pkg/acceptance/testing.go b/pkg/acceptance/testing.go index bd1c6d299f..a0444ea3eb 100644 --- a/pkg/acceptance/testing.go +++ b/pkg/acceptance/testing.go @@ -14,6 +14,7 @@ import ( "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/helpers/random" "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/testenvs" "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/testprofiles" + "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/snowflakeenvs" "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider" "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk" "github.com/hashicorp/terraform-plugin-go/tfprotov5" @@ -23,6 +24,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/config" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/snowflakedb/gosnowflake" + "github.com/stretchr/testify/require" ) const AcceptanceTestPrefix = "acc_test_" @@ -208,3 +210,22 @@ func ExternalProviderWithExactVersion(version string) map[string]resource.Extern }, } } + +// SetV097CompatibleConfigPath sets a new config path in a relevant env variable for a file that is compatible with v0.97. +func SetV097CompatibleConfigPathEnv(t *testing.T) func() { + t.Helper() + return func() { + home, err := os.UserHomeDir() + require.NoError(t, err) + configPath := filepath.Join(home, ".snowflake", "config_v097_compatible") + t.Setenv(snowflakeenvs.ConfigPath, configPath) + } +} + +// UnsetConfigPathEnv unsets a config path env +func UnsetConfigPathEnv(t *testing.T) func() { + t.Helper() + return func() { + t.Setenv(snowflakeenvs.ConfigPath, "") + } +} diff --git a/pkg/provider/provider_acceptance_test.go b/pkg/provider/provider_acceptance_test.go index 5369ada5c6..377c6e8658 100644 --- a/pkg/provider/provider_acceptance_test.go +++ b/pkg/provider/provider_acceptance_test.go @@ -12,7 +12,6 @@ import ( acc "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance" "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk" - "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/testhelpers" "github.com/snowflakedb/gosnowflake" "github.com/stretchr/testify/assert" @@ -165,8 +164,6 @@ func TestAcc_Provider_configureClientOnceSwitching(t *testing.T) { } func TestAcc_Provider_tomlConfig(t *testing.T) { - // TODO(SNOW-1752038): unskip - t.Skip("Skip because this test needs a TOML config incompatible with older versions, causing tests with ExternalProvider to fail.") t.Setenv(string(testenvs.ConfigureClientOnce), "") user := acc.DefaultConfig(t).User @@ -239,8 +236,6 @@ func TestAcc_Provider_tomlConfig(t *testing.T) { } func TestAcc_Provider_envConfig(t *testing.T) { - // TODO(SNOW-1752038): unskip - t.Skip("Skip because this test needs a TOML config incompatible with older versions, causing tests with ExternalProvider to fail.") t.Setenv(string(testenvs.ConfigureClientOnce), "") user := acc.DefaultConfig(t).User @@ -352,8 +347,6 @@ func TestAcc_Provider_envConfig(t *testing.T) { } func TestAcc_Provider_tfConfig(t *testing.T) { - // TODO(SNOW-1752038): unskip - t.Skip("Skip because this test needs a TOML config incompatible with older versions, causing tests with ExternalProvider to fail.") t.Setenv(string(testenvs.ConfigureClientOnce), "") user := acc.DefaultConfig(t).User @@ -499,19 +492,6 @@ func TestAcc_Provider_useNonExistentDefaultParams(t *testing.T) { // prove we can use tri-value booleans, similarly to the ones in resources func TestAcc_Provider_triValueBoolean(t *testing.T) { t.Setenv(string(testenvs.ConfigureClientOnce), "") - account := acc.DefaultConfig(t).Account - user := acc.DefaultConfig(t).User - password := acc.DefaultConfig(t).Password - - // Prepare a temporary TOML config that is valid for v0.97.0. - // The default TOML is not valid because we set new fields, which is incorrect from v0.97.0's point of view. - c := fmt.Sprintf(` - [default] - account='%s' - user='%s' - password='%s' - `, account, user, password) - configPath := testhelpers.TestFile(t, "config", []byte(c)) resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -524,9 +504,7 @@ func TestAcc_Provider_triValueBoolean(t *testing.T) { }, Steps: []resource.TestStep{ { - PreConfig: func() { - t.Setenv(snowflakeenvs.ConfigPath, configPath) - }, + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: acc.ExternalProviderWithExactVersion("0.97.0"), Config: providerConfigWithClientStoreTemporaryCredential(testprofiles.Default, `true`), }, diff --git a/pkg/resources/account_role_acceptance_test.go b/pkg/resources/account_role_acceptance_test.go index cda06bec4d..c956eb43ff 100644 --- a/pkg/resources/account_role_acceptance_test.go +++ b/pkg/resources/account_role_acceptance_test.go @@ -217,6 +217,7 @@ func TestAcc_AccountRole_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t CheckDestroy: acc.CheckDestroy(t, resources.AccountRole), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -229,6 +230,7 @@ func TestAcc_AccountRole_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: accountRoleBasicConfig(id.Name(), comment), Check: resource.ComposeAggregateTestCheckFunc( @@ -252,6 +254,7 @@ func TestAcc_AccountRole_WithQuotedName(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.AccountRole), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -266,6 +269,7 @@ func TestAcc_AccountRole_WithQuotedName(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: accountRoleBasicConfig(quotedId, comment), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/alert_acceptance_test.go b/pkg/resources/alert_acceptance_test.go index 7dd9853e6e..702e5c8e7a 100644 --- a/pkg/resources/alert_acceptance_test.go +++ b/pkg/resources/alert_acceptance_test.go @@ -207,8 +207,8 @@ resource "snowflake_alert" "test_alert" { // Can't reproduce the issue, leaving the test for now. func TestAcc_Alert_Issue3117(t *testing.T) { + // t.Setenv(string(testenvs.ConfigureClientOnce), "") id := acc.TestClient().Ids.RandomSchemaObjectIdentifierWithPrefix("small caps with spaces") - resource.Test(t, resource.TestCase{ PreCheck: func() { acc.TestAccPreCheck(t) }, TerraformVersionChecks: []tfversion.TerraformVersionCheck{ @@ -217,6 +217,7 @@ func TestAcc_Alert_Issue3117(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Alert), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -229,6 +230,7 @@ func TestAcc_Alert_Issue3117(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: alertIssue3117Config(id, acc.TestClient().Ids.WarehouseId(), "test_alert"), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/api_authentication_integration_with_authorization_code_grant_acceptance_test.go b/pkg/resources/api_authentication_integration_with_authorization_code_grant_acceptance_test.go index e8ee7e82bb..57012b3902 100644 --- a/pkg/resources/api_authentication_integration_with_authorization_code_grant_acceptance_test.go +++ b/pkg/resources/api_authentication_integration_with_authorization_code_grant_acceptance_test.go @@ -271,6 +271,7 @@ func TestAcc_ApiAuthenticationIntegrationWithAuthorizationCodeGrant_migrateFromV CheckDestroy: acc.CheckDestroy(t, resources.ApiAuthenticationIntegrationWithAuthorizationCodeGrant), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -283,6 +284,7 @@ func TestAcc_ApiAuthenticationIntegrationWithAuthorizationCodeGrant_migrateFromV ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: apiAuthenticationIntegrationWithAuthorizationCodeGrantBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -305,6 +307,7 @@ func TestAcc_ApiAuthenticationIntegrationWithAuthorizationCodeGrant_WithQuotedNa CheckDestroy: acc.CheckDestroy(t, resources.ApiAuthenticationIntegrationWithAuthorizationCodeGrant), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -319,6 +322,7 @@ func TestAcc_ApiAuthenticationIntegrationWithAuthorizationCodeGrant_WithQuotedNa ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: apiAuthenticationIntegrationWithAuthorizationCodeGrantBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/api_authentication_integration_with_client_credentials_acceptance_test.go b/pkg/resources/api_authentication_integration_with_client_credentials_acceptance_test.go index 799655a517..f300ba22a0 100644 --- a/pkg/resources/api_authentication_integration_with_client_credentials_acceptance_test.go +++ b/pkg/resources/api_authentication_integration_with_client_credentials_acceptance_test.go @@ -264,6 +264,7 @@ func TestAcc_ApiAuthenticationIntegrationWithClientCredentials_migrateFromV0941_ CheckDestroy: acc.CheckDestroy(t, resources.ApiAuthenticationIntegrationWithClientCredentials), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -276,6 +277,7 @@ func TestAcc_ApiAuthenticationIntegrationWithClientCredentials_migrateFromV0941_ ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: apiAuthenticationIntegrationWithClientCredentialsBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -298,6 +300,7 @@ func TestAcc_ApiAuthenticationIntegrationWithClientCredentials_WithQuotedName(t CheckDestroy: acc.CheckDestroy(t, resources.ApiAuthenticationIntegrationWithClientCredentials), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -312,6 +315,7 @@ func TestAcc_ApiAuthenticationIntegrationWithClientCredentials_WithQuotedName(t ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: apiAuthenticationIntegrationWithClientCredentialsBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/api_authentication_integration_with_jwt_bearer_acceptance_test.go b/pkg/resources/api_authentication_integration_with_jwt_bearer_acceptance_test.go index a9ce80b0f4..4b97df6ac8 100644 --- a/pkg/resources/api_authentication_integration_with_jwt_bearer_acceptance_test.go +++ b/pkg/resources/api_authentication_integration_with_jwt_bearer_acceptance_test.go @@ -232,6 +232,7 @@ func TestAcc_ApiAuthenticationIntegrationWithJwtBearer_migrateFromV0941_ensureSm CheckDestroy: acc.CheckDestroy(t, resources.ApiAuthenticationIntegrationWithJwtBearer), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -244,6 +245,7 @@ func TestAcc_ApiAuthenticationIntegrationWithJwtBearer_migrateFromV0941_ensureSm ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: apiAuthenticationIntegrationWithJwtBearerBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -268,6 +270,7 @@ func TestAcc_ApiAuthenticationIntegrationWithJwtBearer_IdentifierQuotingDiffSupp CheckDestroy: acc.CheckDestroy(t, resources.ApiAuthenticationIntegrationWithJwtBearer), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -282,6 +285,7 @@ func TestAcc_ApiAuthenticationIntegrationWithJwtBearer_IdentifierQuotingDiffSupp ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: apiAuthenticationIntegrationWithJwtBearerBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/database_acceptance_test.go b/pkg/resources/database_acceptance_test.go index a1df0a1266..87eefa614e 100644 --- a/pkg/resources/database_acceptance_test.go +++ b/pkg/resources/database_acceptance_test.go @@ -980,6 +980,7 @@ func TestAcc_Database_UpgradeWithTheSameFieldsAsInTheOldOne(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Database), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1045,6 +1046,7 @@ func TestAcc_Database_UpgradeWithDataRetentionSet(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Database), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1108,6 +1110,7 @@ func TestAcc_Database_WithReplication(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Database), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1125,6 +1128,7 @@ func TestAcc_Database_WithReplication(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: databaseStateUpgraderWithReplicationNew(id, secondaryAccountIdentifier), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1267,6 +1271,7 @@ func TestAcc_Database_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t *t CheckDestroy: acc.CheckDestroy(t, resources.Database), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1279,6 +1284,7 @@ func TestAcc_Database_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t *t ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: databaseConfigBasic(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -1315,6 +1321,7 @@ func TestAcc_Database_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Database), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1331,6 +1338,7 @@ func TestAcc_Database_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: databaseConfigBasicWithExternalVolumeAndCatalog(quotedId, quotedExternalVolumeId, quotedCatalogId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/database_role_acceptance_test.go b/pkg/resources/database_role_acceptance_test.go index 1d3552a86c..a75e20c176 100644 --- a/pkg/resources/database_role_acceptance_test.go +++ b/pkg/resources/database_role_acceptance_test.go @@ -161,6 +161,7 @@ func TestAcc_DatabaseRole_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId( }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -173,6 +174,7 @@ func TestAcc_DatabaseRole_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId( ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, databaseRoleModelWithComment), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -204,6 +206,7 @@ func TestAcc_DatabaseRole_IdentifierQuotingDiffSuppression(t *testing.T) { }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -219,6 +222,7 @@ func TestAcc_DatabaseRole_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, databaseRoleModelWithComment), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/external_function_acceptance_test.go b/pkg/resources/external_function_acceptance_test.go index 1ce5b27cf1..325705b597 100644 --- a/pkg/resources/external_function_acceptance_test.go +++ b/pkg/resources/external_function_acceptance_test.go @@ -239,6 +239,7 @@ func TestAcc_ExternalFunction_migrateFromVersion085(t *testing.T) { Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -291,6 +292,7 @@ func TestAcc_ExternalFunction_migrateFromVersion085_issue2694_previousValuePrese Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -335,6 +337,7 @@ func TestAcc_ExternalFunction_migrateFromVersion085_issue2694_previousValueRemov Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -415,6 +418,7 @@ func TestAcc_ExternalFunction_HeaderParsing(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.ExternalFunction), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.93.0", @@ -436,6 +440,7 @@ func TestAcc_ExternalFunction_HeaderParsing(t *testing.T) { ExpectNonEmptyPlan: true, }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalFunctionConfigIssueCurlyHeader(id), Check: resource.ComposeTestCheckFunc( @@ -583,6 +588,7 @@ func TestAcc_ExternalFunction_EnsureSmoothResourceIdMigrationToV0950(t *testing. CheckDestroy: acc.CheckDestroy(t, resources.ExternalFunction), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -595,6 +601,7 @@ func TestAcc_ExternalFunction_EnsureSmoothResourceIdMigrationToV0950(t *testing. ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalFunctionConfigWithMoreArguments(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( @@ -655,6 +662,7 @@ func TestAcc_ExternalFunction_EnsureSmoothResourceIdMigrationToV0950_WithoutArgu CheckDestroy: acc.CheckDestroy(t, resources.ExternalFunction), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -667,6 +675,7 @@ func TestAcc_ExternalFunction_EnsureSmoothResourceIdMigrationToV0950_WithoutArgu ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalFunctionConfigWithoutArguments(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/external_oauth_integration_acceptance_test.go b/pkg/resources/external_oauth_integration_acceptance_test.go index 0732282702..e9e278a2cb 100644 --- a/pkg/resources/external_oauth_integration_acceptance_test.go +++ b/pkg/resources/external_oauth_integration_acceptance_test.go @@ -773,6 +773,7 @@ func TestAcc_ExternalOauthIntegration_migrateFromVersion092_withRsaPublicKeysAnd Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -799,6 +800,7 @@ func TestAcc_ExternalOauthIntegration_migrateFromVersion092_withRsaPublicKeysAnd ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalOauthIntegrationWithRsaPublicKeysAndBlockedRolesListv093(id.Name(), issuer, rsaKey, role.Name), Check: resource.ComposeAggregateTestCheckFunc( @@ -889,6 +891,7 @@ func TestAcc_ExternalOauthIntegration_migrateFromVersion092_withJwsKeysUrlAndAll Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -915,6 +918,7 @@ func TestAcc_ExternalOauthIntegration_migrateFromVersion092_withJwsKeysUrlAndAll ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalOauthIntegrationWithJwsKeysUrlAndAllowedRolesListv093(id.Name(), issuer, role.Name), Check: resource.ComposeAggregateTestCheckFunc( @@ -988,6 +992,7 @@ func TestAcc_ExternalOauthIntegration_migrateFromV0941_ensureSmoothUpgradeWithNe CheckDestroy: acc.CheckDestroy(t, resources.ExternalOauthSecurityIntegration), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1000,6 +1005,7 @@ func TestAcc_ExternalOauthIntegration_migrateFromV0941_ensureSmoothUpgradeWithNe ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalOauthIntegrationBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -1022,6 +1028,7 @@ func TestAcc_ExternalOauthIntegration_WithQuotedName(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.ExternalOauthSecurityIntegration), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1036,6 +1043,7 @@ func TestAcc_ExternalOauthIntegration_WithQuotedName(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalOauthIntegrationBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/function_acceptance_test.go b/pkg/resources/function_acceptance_test.go index 439d7cd47b..d5c1ddc54d 100644 --- a/pkg/resources/function_acceptance_test.go +++ b/pkg/resources/function_acceptance_test.go @@ -203,6 +203,7 @@ func TestAcc_Function_migrateFromVersion085(t *testing.T) { // Added as subtask SNOW-1057066 to SNOW-926148. Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -350,6 +351,7 @@ func TestAcc_Function_EnsureSmoothResourceIdMigrationToV0950(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Function), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -362,6 +364,7 @@ func TestAcc_Function_EnsureSmoothResourceIdMigrationToV0950(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: functionConfigWithMoreArguments(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( @@ -410,6 +413,7 @@ func TestAcc_Function_EnsureSmoothResourceIdMigrationToV0950_WithoutArguments(t CheckDestroy: acc.CheckDestroy(t, resources.Function), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -422,6 +426,7 @@ func TestAcc_Function_EnsureSmoothResourceIdMigrationToV0950_WithoutArguments(t ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: functionConfigWithoutArguments(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/grant_account_role_acceptance_test.go b/pkg/resources/grant_account_role_acceptance_test.go index 3a05e90595..bc8a1a2a8b 100644 --- a/pkg/resources/grant_account_role_acceptance_test.go +++ b/pkg/resources/grant_account_role_acceptance_test.go @@ -103,6 +103,7 @@ func TestAcc_GrantAccountRole_migrateFromV0941_ensureSmoothUpgradeWithNewResourc }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -115,6 +116,7 @@ func TestAcc_GrantAccountRole_migrateFromV0941_ensureSmoothUpgradeWithNewResourc ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantAccountRoleBasicConfig(roleName.Name(), parentRoleName.Name()), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -164,6 +166,7 @@ func TestAcc_GrantAccountRole_IdentifierQuotingDiffSuppression(t *testing.T) { }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -174,6 +177,7 @@ func TestAcc_GrantAccountRole_IdentifierQuotingDiffSuppression(t *testing.T) { Config: grantAccountRoleBasicConfig(quotedRoleId, quotedParentRoleId), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantAccountRoleBasicConfig(quotedRoleId, quotedParentRoleId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/grant_application_role_acceptance_test.go b/pkg/resources/grant_application_role_acceptance_test.go index fb70f56a2f..3f5981d97b 100644 --- a/pkg/resources/grant_application_role_acceptance_test.go +++ b/pkg/resources/grant_application_role_acceptance_test.go @@ -140,6 +140,7 @@ func TestAcc_GrantApplicationRole_migrateFromV0941_ensureSmoothUpgradeWithNewRes }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -152,6 +153,7 @@ func TestAcc_GrantApplicationRole_migrateFromV0941_ensureSmoothUpgradeWithNewRes ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantApplicationRoleBasicConfig(fmt.Sprintf(`\"%s\".\"%s\"`, appRoleId.DatabaseName(), appRoleId.Name()), parentRoleId.Name()), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -200,6 +202,7 @@ func TestAcc_GrantApplicationRole_IdentifierQuotingDiffSuppression(t *testing.T) }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -210,6 +213,7 @@ func TestAcc_GrantApplicationRole_IdentifierQuotingDiffSuppression(t *testing.T) Config: grantApplicationRoleBasicConfig(unquotedApplicationRoleId, quotedParentRoleId), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantApplicationRoleBasicConfig(unquotedApplicationRoleId, quotedParentRoleId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/grant_database_role_acceptance_test.go b/pkg/resources/grant_database_role_acceptance_test.go index 48120de920..467ac339e6 100644 --- a/pkg/resources/grant_database_role_acceptance_test.go +++ b/pkg/resources/grant_database_role_acceptance_test.go @@ -265,6 +265,7 @@ func TestAcc_GrantDatabaseRole_migrateFromV0941_ensureSmoothUpgradeWithNewResour }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -277,6 +278,7 @@ func TestAcc_GrantDatabaseRole_migrateFromV0941_ensureSmoothUpgradeWithNewResour ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantDatabaseRoleBasicConfigQuoted(databaseId.Name(), roleId.Name(), parentRoleId.Name()), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -353,6 +355,7 @@ func TestAcc_GrantDatabaseRole_IdentifierQuotingDiffSuppression(t *testing.T) { }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -367,6 +370,7 @@ func TestAcc_GrantDatabaseRole_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantDatabaseRoleBasicConfigUnquoted(databaseId.Name(), roleId.Name(), parentRoleId.Name()), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/grant_ownership_acceptance_test.go b/pkg/resources/grant_ownership_acceptance_test.go index 4980f1bf37..037acecb47 100644 --- a/pkg/resources/grant_ownership_acceptance_test.go +++ b/pkg/resources/grant_ownership_acceptance_test.go @@ -1360,6 +1360,7 @@ func TestAcc_GrantOwnership_migrateFromV0941_ensureSmoothUpgradeWithNewResourceI }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1372,6 +1373,7 @@ func TestAcc_GrantOwnership_migrateFromV0941_ensureSmoothUpgradeWithNewResourceI ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantOwnershipOnTableBasicConfig(acc.TestDatabaseName, acc.TestSchemaName, tableId.Name(), accountRoleId.Name(), escapedFullyQualifiedName), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1434,6 +1436,7 @@ func TestAcc_GrantOwnership_IdentifierQuotingDiffSuppression(t *testing.T) { }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1447,6 +1450,7 @@ func TestAcc_GrantOwnership_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantOwnershipOnTableBasicConfigWithManagedDatabaseAndSchema(databaseId.Name(), schemaId.Name(), tableId.Name(), accountRoleId.Name(), unescapedFullyQualifiedName), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/grant_privileges_to_account_role_acceptance_test.go b/pkg/resources/grant_privileges_to_account_role_acceptance_test.go index 15cdae3486..47f4c34ccc 100644 --- a/pkg/resources/grant_privileges_to_account_role_acceptance_test.go +++ b/pkg/resources/grant_privileges_to_account_role_acceptance_test.go @@ -1750,6 +1750,7 @@ func TestAcc_GrantPrivilegesToAccountRole_migrateFromV0941_ensureSmoothUpgradeWi }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1762,6 +1763,7 @@ func TestAcc_GrantPrivilegesToAccountRole_migrateFromV0941_ensureSmoothUpgradeWi ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToAccountRoleBasicConfig(accountRoleId.Name(), accountRoleId.Name(), quotedSchemaId), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1812,6 +1814,7 @@ func TestAcc_GrantPrivilegesToAccountRole_IdentifierQuotingDiffSuppression(t *te }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1826,6 +1829,7 @@ func TestAcc_GrantPrivilegesToAccountRole_IdentifierQuotingDiffSuppression(t *te ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToAccountRoleBasicConfig(accountRoleId.Name(), unquotedAccountRoleId, unquotedSchemaId), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1913,6 +1917,7 @@ func TestAcc_GrantPrivilegesToAccountRole_OnFutureModels_issue3050(t *testing.T) CheckDestroy: acc.CheckAccountRolePrivilegesRevoked(t), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.95.0", @@ -1923,6 +1928,7 @@ func TestAcc_GrantPrivilegesToAccountRole_OnFutureModels_issue3050(t *testing.T) ExpectNonEmptyPlan: true, }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToAccountRoleOnFutureInDatabaseConfig(accountRoleName, []string{"USAGE"}, sdk.PluralObjectTypeModels, databaseName), }, diff --git a/pkg/resources/grant_privileges_to_database_role_acceptance_test.go b/pkg/resources/grant_privileges_to_database_role_acceptance_test.go index b3b491cfd8..da535e946e 100644 --- a/pkg/resources/grant_privileges_to_database_role_acceptance_test.go +++ b/pkg/resources/grant_privileges_to_database_role_acceptance_test.go @@ -1388,6 +1388,7 @@ func TestAcc_GrantPrivilegesToDatabaseRole_migrateFromV0941_ensureSmoothUpgradeW }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1400,6 +1401,7 @@ func TestAcc_GrantPrivilegesToDatabaseRole_migrateFromV0941_ensureSmoothUpgradeW ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToDatabaseRoleBasicConfig(acc.TestClient().Ids.DatabaseId().Name(), databaseRoleId.Name(), quotedDatabaseRoleId, quotedSchemaId), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1451,6 +1453,7 @@ func TestAcc_GrantPrivilegesToDatabaseRole_IdentifierQuotingDiffSuppression(t *t }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1465,6 +1468,7 @@ func TestAcc_GrantPrivilegesToDatabaseRole_IdentifierQuotingDiffSuppression(t *t ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToDatabaseRoleBasicConfig(acc.TestClient().Ids.DatabaseId().Name(), databaseRoleId.Name(), unquotedDatabaseRoleId, unquotedSchemaId), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1498,6 +1502,7 @@ func TestAcc_GrantPrivilegesToDatabaseRole_OnFutureModels_issue3050(t *testing.T CheckDestroy: acc.CheckAccountRolePrivilegesRevoked(t), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.95.0", @@ -1508,6 +1513,7 @@ func TestAcc_GrantPrivilegesToDatabaseRole_OnFutureModels_issue3050(t *testing.T ExpectNonEmptyPlan: true, }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToDatabaseRoleOnFutureInDatabaseConfig(databaseRoleId, []string{"USAGE"}, sdk.PluralObjectTypeModels, databaseName), }, diff --git a/pkg/resources/grant_privileges_to_share_acceptance_test.go b/pkg/resources/grant_privileges_to_share_acceptance_test.go index 78ae8a4a01..32099e8cff 100644 --- a/pkg/resources/grant_privileges_to_share_acceptance_test.go +++ b/pkg/resources/grant_privileges_to_share_acceptance_test.go @@ -721,6 +721,7 @@ func TestAcc_GrantPrivilegesToShare_migrateFromV0941_ensureSmoothUpgradeWithNewR }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -733,6 +734,7 @@ func TestAcc_GrantPrivilegesToShare_migrateFromV0941_ensureSmoothUpgradeWithNewR ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToShareBasicConfig(databaseId.Name(), shareId.Name()), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -783,6 +785,7 @@ func TestAcc_GrantPrivilegesToShare_IdentifierQuotingDiffSuppression(t *testing. }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -793,6 +796,7 @@ func TestAcc_GrantPrivilegesToShare_IdentifierQuotingDiffSuppression(t *testing. Config: grantPrivilegesToShareBasicConfig(quotedDatabaseId, quotedShareId), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToShareBasicConfig(quotedDatabaseId, quotedShareId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/masking_policy_acceptance_test.go b/pkg/resources/masking_policy_acceptance_test.go index 98a3648fb9..df08428418 100644 --- a/pkg/resources/masking_policy_acceptance_test.go +++ b/pkg/resources/masking_policy_acceptance_test.go @@ -413,6 +413,7 @@ func TestAcc_MaskingPolicy_migrateFromVersion_0_94_1(t *testing.T) { Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -426,6 +427,7 @@ func TestAcc_MaskingPolicy_migrateFromVersion_0_94_1(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigDirectory: acc.ConfigurationDirectory("TestAcc_MaskingPolicy/basic"), ConfigVariables: tfconfig.ConfigVariablesFromModel(t, policyModel), @@ -570,6 +572,7 @@ func TestAcc_MaskingPolicy_migrateFromVersion_0_95_0(t *testing.T) { PreCheck: func() { acc.TestAccPreCheck(t) }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.95.0", @@ -594,6 +597,7 @@ func TestAcc_MaskingPolicy_migrateFromVersion_0_95_0(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigDirectory: acc.ConfigurationDirectory("TestAcc_MaskingPolicy/complete"), ConfigVariables: tfconfig.ConfigVariablesFromModel(t, policyModel), diff --git a/pkg/resources/network_policy_acceptance_test.go b/pkg/resources/network_policy_acceptance_test.go index 7ba7a143f2..19d1d5a54d 100644 --- a/pkg/resources/network_policy_acceptance_test.go +++ b/pkg/resources/network_policy_acceptance_test.go @@ -479,6 +479,7 @@ func TestAcc_NetworkPolicy_Issue2236(t *testing.T) { // Identifier quoting mismatch (no diff suppression) ExpectNonEmptyPlan: true, PreConfig: func() { + acc.SetV097CompatibleConfigPathEnv(t) acc.TestClient().NetworkRule.CreateWithIdentifier(t, allowedNetworkRuleId) acc.TestClient().NetworkRule.CreateWithIdentifier(t, allowedNetworkRuleId2) acc.TestClient().NetworkRule.CreateWithIdentifier(t, blockedNetworkRuleId) @@ -502,6 +503,7 @@ func TestAcc_NetworkPolicy_Issue2236(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: networkPolicyConfigWithNetworkRules( id.Name(), @@ -554,6 +556,7 @@ func TestAcc_NetworkPolicy_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId CheckDestroy: acc.CheckDestroy(t, resources.NetworkPolicy), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -566,6 +569,7 @@ func TestAcc_NetworkPolicy_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: networkPolicyConfigBasic(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -588,6 +592,7 @@ func TestAcc_NetworkPolicy_WithQuotedName(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.NetworkPolicy), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -602,6 +607,7 @@ func TestAcc_NetworkPolicy_WithQuotedName(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: networkPolicyConfigBasic(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/network_rule_acceptance_test.go b/pkg/resources/network_rule_acceptance_test.go index 0c4e274d88..c87c2f4914 100644 --- a/pkg/resources/network_rule_acceptance_test.go +++ b/pkg/resources/network_rule_acceptance_test.go @@ -134,6 +134,7 @@ func TestAcc_NetworkRule_migrateFromVersion_0_94_1(t *testing.T) { Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -147,6 +148,7 @@ func TestAcc_NetworkRule_migrateFromVersion_0_94_1(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: networkRuleIpv4(id.Name(), acc.TestDatabaseName, acc.TestSchemaName), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/notification_integration_acceptance_test.go b/pkg/resources/notification_integration_acceptance_test.go index fc473440aa..22fc3622f2 100644 --- a/pkg/resources/notification_integration_acceptance_test.go +++ b/pkg/resources/notification_integration_acceptance_test.go @@ -232,6 +232,7 @@ func TestAcc_NotificationIntegration_migrateFromVersion085(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.NotificationIntegration), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -246,6 +247,7 @@ func TestAcc_NotificationIntegration_migrateFromVersion085(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: googleAutoConfigWithoutDirection(accName, gcpPubsubSubscriptionName), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -276,6 +278,7 @@ func TestAcc_NotificationIntegration_migrateFromVersion085_explicitType(t *testi CheckDestroy: acc.CheckDestroy(t, resources.NotificationIntegration), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -288,6 +291,7 @@ func TestAcc_NotificationIntegration_migrateFromVersion085_explicitType(t *testi ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: googleAutoConfig(accName, gcpPubsubSubscriptionName), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/oauth_integration_for_custom_clients_acceptance_test.go b/pkg/resources/oauth_integration_for_custom_clients_acceptance_test.go index 0f77f4e16b..43d5763403 100644 --- a/pkg/resources/oauth_integration_for_custom_clients_acceptance_test.go +++ b/pkg/resources/oauth_integration_for_custom_clients_acceptance_test.go @@ -682,6 +682,7 @@ func TestAcc_OauthIntegrationForCustomClients_migrateFromV0941_ensureSmoothUpgra CheckDestroy: acc.CheckDestroy(t, resourcenames.OauthIntegrationForCustomClients), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -694,6 +695,7 @@ func TestAcc_OauthIntegrationForCustomClients_migrateFromV0941_ensureSmoothUpgra ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: oauthIntegrationForCustomClientsBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -716,6 +718,7 @@ func TestAcc_OauthIntegrationForCustomClients_WithQuotedName(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resourcenames.OauthIntegrationForCustomClients), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -730,6 +733,7 @@ func TestAcc_OauthIntegrationForCustomClients_WithQuotedName(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: oauthIntegrationForCustomClientsBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/oauth_integration_for_partner_applications_acceptance_test.go b/pkg/resources/oauth_integration_for_partner_applications_acceptance_test.go index e9bfe4d778..99f15f2d90 100644 --- a/pkg/resources/oauth_integration_for_partner_applications_acceptance_test.go +++ b/pkg/resources/oauth_integration_for_partner_applications_acceptance_test.go @@ -687,6 +687,7 @@ func TestAcc_OauthIntegrationForPartnerApplications_migrateFromV0941_ensureSmoot CheckDestroy: acc.CheckDestroy(t, resources.OauthIntegrationForPartnerApplications), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -699,6 +700,7 @@ func TestAcc_OauthIntegrationForPartnerApplications_migrateFromV0941_ensureSmoot ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: oauthIntegrationForPartnerApplicationsBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -721,6 +723,7 @@ func TestAcc_OauthIntegrationForPartnerApplications_WithQuotedName(t *testing.T) CheckDestroy: acc.CheckDestroy(t, resources.OauthIntegrationForPartnerApplications), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -735,6 +738,7 @@ func TestAcc_OauthIntegrationForPartnerApplications_WithQuotedName(t *testing.T) ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: oauthIntegrationForPartnerApplicationsBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/password_policy_acceptance_test.go b/pkg/resources/password_policy_acceptance_test.go index 6fef84a84d..a42c0dff9f 100644 --- a/pkg/resources/password_policy_acceptance_test.go +++ b/pkg/resources/password_policy_acceptance_test.go @@ -197,6 +197,7 @@ func TestAcc_PasswordPolicy_migrateFromVersion_0_94_1(t *testing.T) { Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -210,6 +211,7 @@ func TestAcc_PasswordPolicy_migrateFromVersion_0_94_1(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: passwordPolicyBasicConfig(id), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/procedure_acceptance_test.go b/pkg/resources/procedure_acceptance_test.go index 6d0ec93b58..89b2e1f4cf 100644 --- a/pkg/resources/procedure_acceptance_test.go +++ b/pkg/resources/procedure_acceptance_test.go @@ -212,6 +212,7 @@ func TestAcc_Procedure_migrateFromVersion085(t *testing.T) { Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -276,6 +277,7 @@ func TestAcc_Procedure_proveArgsPermanentDiff(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Procedure), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.89.0", @@ -292,6 +294,7 @@ func TestAcc_Procedure_proveArgsPermanentDiff(t *testing.T) { }, }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: sqlProcedureConfigArgsPermanentDiff(acc.TestDatabaseName, acc.TestSchemaName, name), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -319,6 +322,7 @@ func TestAcc_Procedure_returnTypePermanentDiff(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Procedure), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.89.0", @@ -335,6 +339,7 @@ func TestAcc_Procedure_returnTypePermanentDiff(t *testing.T) { }, }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: sqlProcedureConfigReturnTypePermanentDiff(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( @@ -408,6 +413,7 @@ func TestAcc_Procedure_EnsureSmoothResourceIdMigrationToV0950(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Procedure), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -420,6 +426,7 @@ func TestAcc_Procedure_EnsureSmoothResourceIdMigrationToV0950(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: procedureConfigWithMoreArguments(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( @@ -472,6 +479,7 @@ func TestAcc_Procedure_EnsureSmoothResourceIdMigrationToV0950_WithoutArguments(t CheckDestroy: acc.CheckDestroy(t, resources.Function), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -484,6 +492,7 @@ func TestAcc_Procedure_EnsureSmoothResourceIdMigrationToV0950_WithoutArguments(t ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: procedureConfigWithoutArguments(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( @@ -523,6 +532,7 @@ func TestAcc_Procedure_EnsureSmoothResourceIdMigrationToV0950_ArgumentSynonyms(t CheckDestroy: acc.CheckDestroy(t, resources.Procedure), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -535,6 +545,7 @@ func TestAcc_Procedure_EnsureSmoothResourceIdMigrationToV0950_ArgumentSynonyms(t ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: procedureConfigWithArgumentSynonyms(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/resource_monitor_acceptance_test.go b/pkg/resources/resource_monitor_acceptance_test.go index 0f7a02322a..e4888bdbf3 100644 --- a/pkg/resources/resource_monitor_acceptance_test.go +++ b/pkg/resources/resource_monitor_acceptance_test.go @@ -529,6 +529,7 @@ func TestAcc_ResourceMonitor_Issue1990_RemovingResourceMonitorOutsideOfTerraform Steps: []resource.TestStep{ // Create resource monitor { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.69.0", @@ -564,6 +565,7 @@ func TestAcc_ResourceMonitor_Issue1990_RemovingResourceMonitorOutsideOfTerraform }, // Same configuration, but it's the latest version of the provider (0.96.0 and above) { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, configModel), }, @@ -599,6 +601,7 @@ func TestAcc_ResourceMonitor_Issue_TimestampInfinitePlan(t *testing.T) { Steps: []resource.TestStep{ // Create resource monitor without the timestamps { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.90.0", @@ -641,6 +644,7 @@ func TestAcc_ResourceMonitor_Issue_TimestampInfinitePlan(t *testing.T) { }, // Create resource monitor without the timestamps { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, configModel), }, @@ -678,6 +682,7 @@ func TestAcc_ResourceMonitor_Issue1500_CreatingWithOnlyTriggers(t *testing.T) { Steps: []resource.TestStep{ // Create resource monitor with only triggers (old version) { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.90.0", @@ -689,6 +694,7 @@ func TestAcc_ResourceMonitor_Issue1500_CreatingWithOnlyTriggers(t *testing.T) { }, // Create resource monitor with only triggers (the latest version) { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, configModel), ExpectError: regexp.MustCompile("due to Snowflake limiltations you cannot create Resource Monitor with only triggers set"), @@ -730,6 +736,7 @@ func TestAcc_ResourceMonitor_Issue1500_AlteringWithOnlyTriggers(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.ResourceMonitor), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.90.0", @@ -763,6 +770,7 @@ func TestAcc_ResourceMonitor_Issue1500_AlteringWithOnlyTriggers(t *testing.T) { }, // Upgrade to the latest version { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, configModelWithCreditQuota), }, @@ -898,6 +906,7 @@ func TestAcc_ResourceMonitor_SetForWarehouse(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.ResourceMonitor), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.90.0", @@ -917,6 +926,7 @@ resource "snowflake_resource_monitor" "test" { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: fmt.Sprintf(` resource "snowflake_resource_monitor" "test" { diff --git a/pkg/resources/row_access_policy_acceptance_test.go b/pkg/resources/row_access_policy_acceptance_test.go index 5dfeddcaed..df84179e6c 100644 --- a/pkg/resources/row_access_policy_acceptance_test.go +++ b/pkg/resources/row_access_policy_acceptance_test.go @@ -208,6 +208,7 @@ func TestAcc_RowAccessPolicy_Issue2053(t *testing.T) { PreCheck: func() { acc.TestAccPreCheck(t) }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.95.0", @@ -228,6 +229,7 @@ func TestAcc_RowAccessPolicy_Issue2053(t *testing.T) { ExpectNonEmptyPlan: true, }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigDirectory: acc.ConfigurationDirectory("TestAcc_RowAccessPolicy/basic"), ConfigVariables: tfconfig.ConfigVariablesFromModel(t, policyModel), @@ -425,6 +427,7 @@ func TestAcc_RowAccessPolicy_migrateFromVersion_0_95_0_LowercaseArgName(t *testi PreCheck: func() { acc.TestAccPreCheck(t) }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.95.0", @@ -450,6 +453,7 @@ func TestAcc_RowAccessPolicy_migrateFromVersion_0_95_0_LowercaseArgName(t *testi ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigDirectory: acc.ConfigurationDirectory("TestAcc_RowAccessPolicy/basic"), ConfigVariables: tfconfig.ConfigVariablesFromModel(t, policyModel), @@ -505,6 +509,7 @@ func TestAcc_RowAccessPolicy_migrateFromVersion_0_95_0_UppercaseArgName(t *testi PreCheck: func() { acc.TestAccPreCheck(t) }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.95.0", @@ -530,6 +535,7 @@ func TestAcc_RowAccessPolicy_migrateFromVersion_0_95_0_UppercaseArgName(t *testi ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigDirectory: acc.ConfigurationDirectory("TestAcc_RowAccessPolicy/basic"), ConfigVariables: tfconfig.ConfigVariablesFromModel(t, policyModel), diff --git a/pkg/resources/saml2_integration_acceptance_test.go b/pkg/resources/saml2_integration_acceptance_test.go index 352c58c884..5640b13250 100644 --- a/pkg/resources/saml2_integration_acceptance_test.go +++ b/pkg/resources/saml2_integration_acceptance_test.go @@ -1082,6 +1082,7 @@ func TestAcc_Saml2Integration_migrateFromV0941_ensureSmoothUpgradeWithNewResourc CheckDestroy: acc.CheckDestroy(t, resources.Saml2SecurityIntegration), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1094,6 +1095,7 @@ func TestAcc_Saml2Integration_migrateFromV0941_ensureSmoothUpgradeWithNewResourc ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: saml2IntegrationBasicConfig(id.Name(), cert), Check: resource.ComposeAggregateTestCheckFunc( @@ -1117,6 +1119,7 @@ func TestAcc_Saml2Integration_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Saml2SecurityIntegration), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1131,6 +1134,7 @@ func TestAcc_Saml2Integration_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: saml2IntegrationBasicConfig(quotedId, cert), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/schema_acceptance_test.go b/pkg/resources/schema_acceptance_test.go index 03551b68f5..7bbc924478 100644 --- a/pkg/resources/schema_acceptance_test.go +++ b/pkg/resources/schema_acceptance_test.go @@ -465,6 +465,7 @@ func TestAcc_Schema_ManagePublicVersion_0_94_0(t *testing.T) { Steps: []resource.TestStep{ // PUBLIC can not be created in v0.93 { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.93.0", @@ -543,6 +544,7 @@ func TestAcc_Schema_ManagePublicVersion_0_94_1(t *testing.T) { Steps: []resource.TestStep{ // PUBLIC can not be created in v0.93 { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.93.0", @@ -553,6 +555,7 @@ func TestAcc_Schema_ManagePublicVersion_0_94_1(t *testing.T) { ExpectError: regexp.MustCompile("Error: error creating schema PUBLIC"), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: schemav094WithPipeExecutionPaused(name, db.ID().Name(), true), Check: resource.ComposeTestCheckFunc( @@ -958,6 +961,7 @@ func TestAcc_Schema_migrateFromVersion093WithoutManagedAccess(t *testing.T) { Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.93.0", @@ -971,6 +975,7 @@ func TestAcc_Schema_migrateFromVersion093WithoutManagedAccess(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: schemav094(id.Name(), databaseId.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -1000,6 +1005,7 @@ func TestAcc_Schema_migrateFromVersion093(t *testing.T) { Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.93.0", @@ -1017,6 +1023,7 @@ func TestAcc_Schema_migrateFromVersion093(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: schemav094WithManagedAccessAndDataRetentionTimeInDays(id.Name(), databaseId.Name(), true, 10), Check: resource.ComposeAggregateTestCheckFunc( @@ -1104,6 +1111,7 @@ func TestAcc_Schema_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t *tes CheckDestroy: acc.CheckDestroy(t, resources.Schema), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1116,6 +1124,7 @@ func TestAcc_Schema_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t *tes ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: schemaBasicConfig(id.DatabaseName(), id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -1148,6 +1157,7 @@ func TestAcc_Schema_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Schema), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1163,6 +1173,7 @@ func TestAcc_Schema_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: schemaBasicConfig(quotedDatabaseName, quotedName), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/scim_integration_acceptance_test.go b/pkg/resources/scim_integration_acceptance_test.go index a1a3812f82..3769c65dfa 100644 --- a/pkg/resources/scim_integration_acceptance_test.go +++ b/pkg/resources/scim_integration_acceptance_test.go @@ -425,6 +425,7 @@ func TestAcc_ScimIntegration_migrateFromVersion092EnabledTrue(t *testing.T) { Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -438,6 +439,7 @@ func TestAcc_ScimIntegration_migrateFromVersion092EnabledTrue(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: scimIntegrationv093(id.Name(), role.Name(), true, sdk.ScimSecurityIntegrationScimClientGeneric), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -473,6 +475,7 @@ func TestAcc_ScimIntegration_migrateFromVersion092EnabledFalse(t *testing.T) { Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -486,6 +489,7 @@ func TestAcc_ScimIntegration_migrateFromVersion092EnabledFalse(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: scimIntegrationv093(id.Name(), role.Name(), false, sdk.ScimSecurityIntegrationScimClientGeneric), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -514,6 +518,7 @@ func TestAcc_ScimIntegration_migrateFromVersion093HandleSyncPassword(t *testing. Steps: []resource.TestStep{ // create resource with v0.92 { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -547,6 +552,7 @@ func TestAcc_ScimIntegration_migrateFromVersion093HandleSyncPassword(t *testing. }, // check with newest version - the value in state was set to boolean default, so there should be no diff { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: scimIntegrationv093(id.Name(), role.Name(), true, sdk.ScimSecurityIntegrationScimClientAzure), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -596,6 +602,7 @@ func TestAcc_ScimIntegration_migrateFromV0941_ensureSmoothUpgradeWithNewResource CheckDestroy: acc.CheckDestroy(t, resources.ScimSecurityIntegration), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -608,6 +615,7 @@ func TestAcc_ScimIntegration_migrateFromV0941_ensureSmoothUpgradeWithNewResource ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: scimIntegrationBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -630,6 +638,7 @@ func TestAcc_ScimIntegration_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.ScimSecurityIntegration), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -644,6 +653,7 @@ func TestAcc_ScimIntegration_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: scimIntegrationBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/secondary_database_acceptance_test.go b/pkg/resources/secondary_database_acceptance_test.go index e499a08317..f551b44d5c 100644 --- a/pkg/resources/secondary_database_acceptance_test.go +++ b/pkg/resources/secondary_database_acceptance_test.go @@ -541,6 +541,7 @@ func TestAcc_SecondaryDatabase_migrateFromV0941_ensureSmoothUpgradeWithNewResour CheckDestroy: acc.CheckDestroy(t, resources.SecondaryDatabase), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -553,6 +554,7 @@ func TestAcc_SecondaryDatabase_migrateFromV0941_ensureSmoothUpgradeWithNewResour ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: secondaryDatabaseConfigBasic(id.Name(), externalPrimaryId.FullyQualifiedName()), Check: resource.ComposeAggregateTestCheckFunc( @@ -591,6 +593,7 @@ func TestAcc_SecondaryDatabase_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.SecondaryDatabase), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -605,6 +608,7 @@ func TestAcc_SecondaryDatabase_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: secondaryDatabaseConfigBasic(quotedId, unquotedExternalPrimaryId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/shared_database_acceptance_test.go b/pkg/resources/shared_database_acceptance_test.go index c31314899e..58a18cb6d7 100644 --- a/pkg/resources/shared_database_acceptance_test.go +++ b/pkg/resources/shared_database_acceptance_test.go @@ -306,6 +306,7 @@ func TestAcc_SharedDatabase_migrateFromV0941_ensureSmoothUpgradeWithNewResourceI CheckDestroy: acc.CheckDestroy(t, resources.SharedDatabase), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -318,6 +319,7 @@ func TestAcc_SharedDatabase_migrateFromV0941_ensureSmoothUpgradeWithNewResourceI ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: sharedDatabaseConfigBasic(id.Name(), externalShareId.FullyQualifiedName()), Check: resource.ComposeAggregateTestCheckFunc( @@ -355,6 +357,7 @@ func TestAcc_SharedDatabase_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.SharedDatabase), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -369,6 +372,7 @@ func TestAcc_SharedDatabase_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: sharedDatabaseConfigBasic(quotedId, unquotedExternalShareId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/streamlit_acceptance_test.go b/pkg/resources/streamlit_acceptance_test.go index f18722a6c3..51647aaacd 100644 --- a/pkg/resources/streamlit_acceptance_test.go +++ b/pkg/resources/streamlit_acceptance_test.go @@ -449,6 +449,7 @@ func TestAcc_Streamlit_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t * CheckDestroy: acc.CheckDestroy(t, resources.Streamlit), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -461,6 +462,7 @@ func TestAcc_Streamlit_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t * ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: streamlitBasicConfig(id, stage.ID(), "main_file"), Check: resource.ComposeAggregateTestCheckFunc( @@ -501,6 +503,7 @@ func TestAcc_Streamlit_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Streamlit), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -517,6 +520,7 @@ func TestAcc_Streamlit_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: streamlitBasicConfigWithRawIdentifierValues(quotedDatabaseName, quotedSchemaName, quotedName, stage.ID().Name(), "main_file"), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/table_acceptance_test.go b/pkg/resources/table_acceptance_test.go index f0fc349780..85a6ebbdfd 100644 --- a/pkg/resources/table_acceptance_test.go +++ b/pkg/resources/table_acceptance_test.go @@ -1994,6 +1994,7 @@ func TestAcc_Table_migrateFromVersion_0_94_1(t *testing.T) { Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -2007,6 +2008,7 @@ func TestAcc_Table_migrateFromVersion_0_94_1(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: tableConfig(id.Name(), id.DatabaseName(), id.SchemaName()), Check: resource.ComposeTestCheckFunc( @@ -2032,6 +2034,7 @@ func TestAcc_Table_SuppressQuotingOnDefaultSequence_issue2644(t *testing.T) { }, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -2042,6 +2045,7 @@ func TestAcc_Table_SuppressQuotingOnDefaultSequence_issue2644(t *testing.T) { Config: tableConfigWithSequence(name, databaseName, schemaName), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: tableConfigWithSequence(name, databaseName, schemaName), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/table_constraint_acceptance_test.go b/pkg/resources/table_constraint_acceptance_test.go index 2feb8eca0c..d6e3556144 100644 --- a/pkg/resources/table_constraint_acceptance_test.go +++ b/pkg/resources/table_constraint_acceptance_test.go @@ -232,6 +232,7 @@ func TestAcc_Table_issue2535_newConstraint(t *testing.T) { CheckDestroy: nil, Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.86.0", @@ -254,6 +255,7 @@ func TestAcc_Table_issue2535_newConstraint(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: tableConstraintUniqueConfigUsingTableId(accName, acc.TestDatabaseName, acc.TestSchemaName, "|"), ExpectError: regexp.MustCompile(`.*Expected SchemaObjectIdentifier identifier type, but got:.*`), @@ -282,6 +284,7 @@ func TestAcc_Table_issue2535_existingTable(t *testing.T) { Steps: []resource.TestStep{ // reference done by table.id in 0.85.0 { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -306,6 +309,7 @@ func TestAcc_Table_issue2535_existingTable(t *testing.T) { }, // fixed in the current version { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: tableConstraintUniqueConfigUsingFullyQualifiedName(accName, acc.TestDatabaseName, acc.TestSchemaName), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/user_acceptance_test.go b/pkg/resources/user_acceptance_test.go index 17e5ef747d..3505780123 100644 --- a/pkg/resources/user_acceptance_test.go +++ b/pkg/resources/user_acceptance_test.go @@ -1350,6 +1350,7 @@ func TestAcc_User_migrateFromVersion094_noDefaultSecondaryRolesSet(t *testing.T) CheckDestroy: acc.CheckDestroy(t, resources.User), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1363,6 +1364,7 @@ func TestAcc_User_migrateFromVersion094_noDefaultSecondaryRolesSet(t *testing.T) ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, userModel), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1395,6 +1397,7 @@ func TestAcc_User_migrateFromVersion094_defaultSecondaryRolesSet(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.User), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1413,6 +1416,7 @@ resource "snowflake_user" "test" { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, userModelWithOptionAll), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/view_acceptance_test.go b/pkg/resources/view_acceptance_test.go index 462f4ee6b8..0417874815 100644 --- a/pkg/resources/view_acceptance_test.go +++ b/pkg/resources/view_acceptance_test.go @@ -1253,6 +1253,7 @@ func TestAcc_view_migrateFromVersion_0_94_1(t *testing.T) { Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1269,6 +1270,7 @@ func TestAcc_view_migrateFromVersion_0_94_1(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigDirectory: acc.ConfigurationDirectory("TestAcc_View/basic"), ConfigVariables: viewConfig, diff --git a/pkg/resources/warehouse_acceptance_test.go b/pkg/resources/warehouse_acceptance_test.go index 2d49146eed..16ee28db0c 100644 --- a/pkg/resources/warehouse_acceptance_test.go +++ b/pkg/resources/warehouse_acceptance_test.go @@ -1452,6 +1452,7 @@ func TestAcc_Warehouse_migrateFromVersion092_withWarehouseSize(t *testing.T) { Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1465,6 +1466,7 @@ func TestAcc_Warehouse_migrateFromVersion092_withWarehouseSize(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigPlanChecks: resource.ConfigPlanChecks{ PreApply: []plancheck.PlanCheck{ @@ -1493,6 +1495,7 @@ func TestAcc_Warehouse_migrateFromVersion092_allFieldsFilledBeforeMigration(t *t Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1507,6 +1510,7 @@ func TestAcc_Warehouse_migrateFromVersion092_allFieldsFilledBeforeMigration(t *t ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseFullMigrationConfig(id.Name(), false), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1553,6 +1557,7 @@ func TestAcc_Warehouse_migrateFromVersion092_allFieldsFilledBeforeMigration_bool Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1569,6 +1574,7 @@ func TestAcc_Warehouse_migrateFromVersion092_allFieldsFilledBeforeMigration_bool }, // let's try to change the value of the parameter that was earlier a bool and now is a string { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigPlanChecks: resource.ConfigPlanChecks{ PreApply: []plancheck.PlanCheck{ @@ -1600,6 +1606,7 @@ func TestAcc_Warehouse_migrateFromVersion092_queryAccelerationMaxScaleFactor_sam Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1613,6 +1620,7 @@ func TestAcc_Warehouse_migrateFromVersion092_queryAccelerationMaxScaleFactor_sam ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseFullDefaultConfig(id.Name(), ""), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1646,6 +1654,7 @@ func TestAcc_Warehouse_migrateFromVersion092_queryAccelerationMaxScaleFactor_noI Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1659,6 +1668,7 @@ func TestAcc_Warehouse_migrateFromVersion092_queryAccelerationMaxScaleFactor_noI ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseFullDefaultConfigWithQueryAccelerationMaxScaleFactorRemoved(id.Name(), ""), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1692,6 +1702,7 @@ func TestAcc_Warehouse_migrateFromVersion092_queryAccelerationMaxScaleFactor_dif Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1705,6 +1716,7 @@ func TestAcc_Warehouse_migrateFromVersion092_queryAccelerationMaxScaleFactor_dif ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseFullDefaultConfigWithQueryAcceleration(id.Name(), "", true, 10), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1737,6 +1749,7 @@ func TestAcc_Warehouse_migrateFromVersion092_noConfigToFullConfig(t *testing.T) Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1750,6 +1763,7 @@ func TestAcc_Warehouse_migrateFromVersion092_noConfigToFullConfig(t *testing.T) ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseFullDefaultConfigWithQueryAcceleration(id.Name(), "", true, 8), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1792,6 +1806,7 @@ func TestAcc_Warehouse_migrateFromVersion092_defaultsRemoved(t *testing.T) { Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1821,6 +1836,7 @@ func TestAcc_Warehouse_migrateFromVersion092_defaultsRemoved(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseWithSizeConfig(id.Name(), string(sdk.WarehouseSizeXSmall)), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1860,6 +1876,7 @@ func TestAcc_Warehouse_migrateFromVersion092_warehouseSizeCausingForceNew(t *tes Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1872,6 +1889,7 @@ func TestAcc_Warehouse_migrateFromVersion092_warehouseSizeCausingForceNew(t *tes ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseBasicConfig(id.Name()), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1898,6 +1916,7 @@ func TestAcc_Warehouse_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t * CheckDestroy: acc.CheckDestroy(t, resources.Warehouse), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1910,6 +1929,7 @@ func TestAcc_Warehouse_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t * ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -1932,6 +1952,7 @@ func TestAcc_Warehouse_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Warehouse), Steps: []resource.TestStep{ { + PreConfig: acc.SetV097CompatibleConfigPathEnv(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1946,6 +1967,7 @@ func TestAcc_Warehouse_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { + PreConfig: acc.UnsetConfigPathEnv(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ From 89ff7f507eb619ba1db35b19f6776ac04681c191 Mon Sep 17 00:00:00 2001 From: Jakub Michalak Date: Thu, 7 Nov 2024 15:56:44 +0100 Subject: [PATCH 02/10] Fix mkdir in github setup --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b1afa8a6e7..3ec814e652 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,11 +41,11 @@ jobs: - name: Create and populate .snowflake/config file id: create_config - run: mkdir $HOME/.snowflake && echo "${{ secrets.SNOWFLAKE_CONFIG_FILE }}" > $HOME/.snowflake/config + run: mkdir -p $HOME/.snowflake && echo "${{ secrets.SNOWFLAKE_CONFIG_FILE }}" > $HOME/.snowflake/config - name: Create and populate .snowflake/config_v097_compatible file id: create_config_v097_compatible - run: mkdir $HOME/.snowflake && echo "${{ secrets.SNOWFLAKE_CONFIG_FILE_V097_COMPATIBLE }}" > $HOME/.snowflake/config_v097_compatible + run: mkdir -p $HOME/.snowflake && echo "${{ secrets.SNOWFLAKE_CONFIG_FILE_V097_COMPATIBLE }}" > $HOME/.snowflake/config_v097_compatible - run: make test if: ${{ !cancelled() && steps.create_config.conclusion == 'success' }} From 2f086f9ce0c35deda67989c307d6b6bbfee695cb Mon Sep 17 00:00:00 2001 From: Jakub Michalak Date: Thu, 7 Nov 2024 17:03:31 +0100 Subject: [PATCH 03/10] Use tmp config files --- .github/workflows/tests.yml | 4 ++-- .../testprofiles/testing_config_profiles.go | 3 +++ pkg/provider/provider_acceptance_test.go | 15 ++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3ec814e652..cf2ed779df 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,11 +41,11 @@ jobs: - name: Create and populate .snowflake/config file id: create_config - run: mkdir -p $HOME/.snowflake && echo "${{ secrets.SNOWFLAKE_CONFIG_FILE }}" > $HOME/.snowflake/config + run: mkdir -p $HOME/.snowflake && echo "${{ secrets.TMP_JMICHALAK_SNOWFLAKE_CONFIG_FILE }}" > $HOME/.snowflake/config - name: Create and populate .snowflake/config_v097_compatible file id: create_config_v097_compatible - run: mkdir -p $HOME/.snowflake && echo "${{ secrets.SNOWFLAKE_CONFIG_FILE_V097_COMPATIBLE }}" > $HOME/.snowflake/config_v097_compatible + run: mkdir -p $HOME/.snowflake && echo "${{ secrets.TMP_JMICHALAK_SNOWFLAKE_CONFIG_FILE_V097_COMPATIBLE }}" > $HOME/.snowflake/config_v097_compatible - run: make test if: ${{ !cancelled() && steps.create_config.conclusion == 'success' }} diff --git a/pkg/acceptance/testprofiles/testing_config_profiles.go b/pkg/acceptance/testprofiles/testing_config_profiles.go index 23ff0fb9c2..00b7039fbb 100644 --- a/pkg/acceptance/testprofiles/testing_config_profiles.go +++ b/pkg/acceptance/testprofiles/testing_config_profiles.go @@ -9,4 +9,7 @@ const ( CompleteFields = "complete_fields" CompleteFieldsInvalid = "complete_fields_invalid" DefaultWithPasscode = "default_with_passcode" + + JwtAuth = "jwt_auth" + EncryptedJwtAuth = "encrypted_jwt_auth" ) diff --git a/pkg/provider/provider_acceptance_test.go b/pkg/provider/provider_acceptance_test.go index 377c6e8658..779c05c23d 100644 --- a/pkg/provider/provider_acceptance_test.go +++ b/pkg/provider/provider_acceptance_test.go @@ -550,9 +550,6 @@ func TestAcc_Provider_sessionParameters(t *testing.T) { } func TestAcc_Provider_JwtAuth(t *testing.T) { - // TODO(SNOW-1752038): unskip - t.Skip("Skip because this test needs a TOML config incompatible with older versions, causing tests with ExternalProvider to fail.") - t.Setenv(string(testenvs.ConfigureClientOnce), "") resource.Test(t, resource.TestCase{ @@ -568,16 +565,16 @@ func TestAcc_Provider_JwtAuth(t *testing.T) { Steps: []resource.TestStep{ // authenticate with unencrypted private key { - Config: providerConfigWithAuthenticator("jwt_test", sdk.AuthenticationTypeJwt), + Config: providerConfigWithAuthenticator(testprofiles.JwtAuth, sdk.AuthenticationTypeJwt), }, // authenticate with unencrypted private key with a legacy authenticator value // solves https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2983 { - Config: providerConfigWithAuthenticator("jwt_test", sdk.AuthenticationTypeJwtLegacy), + Config: providerConfigWithAuthenticator(testprofiles.JwtAuth, sdk.AuthenticationTypeJwtLegacy), }, // authenticate with encrypted private key { - Config: providerConfigWithAuthenticator("jwt_encrypted_test", sdk.AuthenticationTypeJwt), + Config: providerConfigWithAuthenticator(testprofiles.EncryptedJwtAuth, sdk.AuthenticationTypeJwt), }, }, }) @@ -831,10 +828,10 @@ provider "snowflake" { } func datasourceConfig() string { - return fmt.Sprintf(` + return ` data snowflake_database "t" { - name = "%s" -}`, acc.TestDatabaseName) + name = "SNOWFLAKE" +}` } func providerConfigAllFields(profile, orgName, accountName, user, password string) string { From 8dad7c5538a1f79bc5d91c07b21989ef52749071 Mon Sep 17 00:00:00 2001 From: Jakub Michalak Date: Thu, 7 Nov 2024 17:14:58 +0100 Subject: [PATCH 04/10] Add okta profile --- pkg/acceptance/testprofiles/testing_config_profiles.go | 1 + pkg/manual_tests/authentication_methods/auth_test.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/acceptance/testprofiles/testing_config_profiles.go b/pkg/acceptance/testprofiles/testing_config_profiles.go index 00b7039fbb..c671c4219c 100644 --- a/pkg/acceptance/testprofiles/testing_config_profiles.go +++ b/pkg/acceptance/testprofiles/testing_config_profiles.go @@ -12,4 +12,5 @@ const ( JwtAuth = "jwt_auth" EncryptedJwtAuth = "encrypted_jwt_auth" + Okta = "okta" ) diff --git a/pkg/manual_tests/authentication_methods/auth_test.go b/pkg/manual_tests/authentication_methods/auth_test.go index 1e8fbef848..5089009e3a 100644 --- a/pkg/manual_tests/authentication_methods/auth_test.go +++ b/pkg/manual_tests/authentication_methods/auth_test.go @@ -31,7 +31,7 @@ func TestAcc_Provider_OktaAuth(t *testing.T) { }, Steps: []resource.TestStep{ { - Config: providerConfigWithAuthenticator("okta", sdk.AuthenticationTypeOkta), + Config: providerConfigWithAuthenticator(testprofiles.Okta, sdk.AuthenticationTypeOkta), }, }, }) From 8d59be77692a24935a49e8d9113e745b8ca110dd Mon Sep 17 00:00:00 2001 From: Jakub Michalak Date: Fri, 8 Nov 2024 13:58:17 +0100 Subject: [PATCH 05/10] fix --- pkg/provider/provider_acceptance_test.go | 6 +++--- pkg/resources/alert_acceptance_test.go | 1 - pkg/resources/custom_diffs_test.go | 2 -- pkg/resources/network_policy_acceptance_test.go | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/pkg/provider/provider_acceptance_test.go b/pkg/provider/provider_acceptance_test.go index 779c05c23d..11e75134be 100644 --- a/pkg/provider/provider_acceptance_test.go +++ b/pkg/provider/provider_acceptance_test.go @@ -828,10 +828,10 @@ provider "snowflake" { } func datasourceConfig() string { - return ` + return fmt.Sprintf(` data snowflake_database "t" { - name = "SNOWFLAKE" -}` + name = "%s" +}`, acc.TestDatabaseName) } func providerConfigAllFields(profile, orgName, accountName, user, password string) string { diff --git a/pkg/resources/alert_acceptance_test.go b/pkg/resources/alert_acceptance_test.go index 702e5c8e7a..6392543f4b 100644 --- a/pkg/resources/alert_acceptance_test.go +++ b/pkg/resources/alert_acceptance_test.go @@ -207,7 +207,6 @@ resource "snowflake_alert" "test_alert" { // Can't reproduce the issue, leaving the test for now. func TestAcc_Alert_Issue3117(t *testing.T) { - // t.Setenv(string(testenvs.ConfigureClientOnce), "") id := acc.TestClient().Ids.RandomSchemaObjectIdentifierWithPrefix("small caps with spaces") resource.Test(t, resource.TestCase{ PreCheck: func() { acc.TestAccPreCheck(t) }, diff --git a/pkg/resources/custom_diffs_test.go b/pkg/resources/custom_diffs_test.go index efdccb8117..eeab92071c 100644 --- a/pkg/resources/custom_diffs_test.go +++ b/pkg/resources/custom_diffs_test.go @@ -5,8 +5,6 @@ import ( "strings" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" - "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/provider" "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources" "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk" diff --git a/pkg/resources/network_policy_acceptance_test.go b/pkg/resources/network_policy_acceptance_test.go index 19d1d5a54d..96cde7161a 100644 --- a/pkg/resources/network_policy_acceptance_test.go +++ b/pkg/resources/network_policy_acceptance_test.go @@ -479,7 +479,7 @@ func TestAcc_NetworkPolicy_Issue2236(t *testing.T) { // Identifier quoting mismatch (no diff suppression) ExpectNonEmptyPlan: true, PreConfig: func() { - acc.SetV097CompatibleConfigPathEnv(t) + acc.SetV097CompatibleConfigPathEnv(t)() acc.TestClient().NetworkRule.CreateWithIdentifier(t, allowedNetworkRuleId) acc.TestClient().NetworkRule.CreateWithIdentifier(t, allowedNetworkRuleId2) acc.TestClient().NetworkRule.CreateWithIdentifier(t, blockedNetworkRuleId) From ee5104b67cb192f8f5390083b1d3a516cb24004a Mon Sep 17 00:00:00 2001 From: Jakub Michalak Date: Fri, 15 Nov 2024 17:55:01 +0100 Subject: [PATCH 06/10] Review --- pkg/acceptance/testing.go | 8 ++-- pkg/provider/provider_acceptance_test.go | 2 +- pkg/resources/account_role_acceptance_test.go | 8 ++-- pkg/resources/alert_acceptance_test.go | 4 +- ...uthorization_code_grant_acceptance_test.go | 8 ++-- ...with_client_credentials_acceptance_test.go | 8 ++-- ...gration_with_jwt_bearer_acceptance_test.go | 8 ++-- pkg/resources/database_acceptance_test.go | 16 +++---- .../database_role_acceptance_test.go | 8 ++-- .../external_function_acceptance_test.go | 18 ++++---- ...ernal_oauth_integration_acceptance_test.go | 16 +++---- pkg/resources/function_acceptance_test.go | 10 ++--- .../grant_account_role_acceptance_test.go | 8 ++-- .../grant_application_role_acceptance_test.go | 8 ++-- .../grant_database_role_acceptance_test.go | 8 ++-- .../grant_ownership_acceptance_test.go | 8 ++-- ...vileges_to_account_role_acceptance_test.go | 12 ++--- ...ileges_to_database_role_acceptance_test.go | 12 ++--- ...ant_privileges_to_share_acceptance_test.go | 8 ++-- .../masking_policy_acceptance_test.go | 8 ++-- .../network_policy_acceptance_test.go | 12 ++--- pkg/resources/network_rule_acceptance_test.go | 4 +- ...otification_integration_acceptance_test.go | 8 ++-- ...tion_for_custom_clients_acceptance_test.go | 8 ++-- ...or_partner_applications_acceptance_test.go | 8 ++-- .../password_policy_acceptance_test.go | 4 +- pkg/resources/procedure_acceptance_test.go | 22 +++++----- .../resource_monitor_acceptance_test.go | 20 ++++----- .../row_access_policy_acceptance_test.go | 12 ++--- .../saml2_integration_acceptance_test.go | 8 ++-- pkg/resources/schema_acceptance_test.go | 22 +++++----- .../scim_integration_acceptance_test.go | 20 ++++----- .../secondary_database_acceptance_test.go | 8 ++-- .../shared_database_acceptance_test.go | 8 ++-- pkg/resources/streamlit_acceptance_test.go | 8 ++-- pkg/resources/table_acceptance_test.go | 8 ++-- .../table_constraint_acceptance_test.go | 8 ++-- pkg/resources/user_acceptance_test.go | 14 +++--- ...sword_policy_attachment_acceptance_test.go | 3 +- pkg/resources/view_acceptance_test.go | 4 +- pkg/resources/warehouse_acceptance_test.go | 44 +++++++++---------- 41 files changed, 222 insertions(+), 217 deletions(-) diff --git a/pkg/acceptance/testing.go b/pkg/acceptance/testing.go index a0444ea3eb..765abc5043 100644 --- a/pkg/acceptance/testing.go +++ b/pkg/acceptance/testing.go @@ -211,8 +211,8 @@ func ExternalProviderWithExactVersion(version string) map[string]resource.Extern } } -// SetV097CompatibleConfigPath sets a new config path in a relevant env variable for a file that is compatible with v0.97. -func SetV097CompatibleConfigPathEnv(t *testing.T) func() { +// SetV097CompatibleConfigPathEnvFunc sets a new config path in a relevant env variable for a file that is compatible with v0.97. +func SetV097CompatibleConfigPathEnvFunc(t *testing.T) func() { t.Helper() return func() { home, err := os.UserHomeDir() @@ -222,8 +222,8 @@ func SetV097CompatibleConfigPathEnv(t *testing.T) func() { } } -// UnsetConfigPathEnv unsets a config path env -func UnsetConfigPathEnv(t *testing.T) func() { +// UnsetConfigPathEnvFunc unsets a config path env +func UnsetConfigPathEnvFunc(t *testing.T) func() { t.Helper() return func() { t.Setenv(snowflakeenvs.ConfigPath, "") diff --git a/pkg/provider/provider_acceptance_test.go b/pkg/provider/provider_acceptance_test.go index 11e75134be..4a1763040d 100644 --- a/pkg/provider/provider_acceptance_test.go +++ b/pkg/provider/provider_acceptance_test.go @@ -504,7 +504,7 @@ func TestAcc_Provider_triValueBoolean(t *testing.T) { }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: acc.ExternalProviderWithExactVersion("0.97.0"), Config: providerConfigWithClientStoreTemporaryCredential(testprofiles.Default, `true`), }, diff --git a/pkg/resources/account_role_acceptance_test.go b/pkg/resources/account_role_acceptance_test.go index c956eb43ff..08c6625509 100644 --- a/pkg/resources/account_role_acceptance_test.go +++ b/pkg/resources/account_role_acceptance_test.go @@ -217,7 +217,7 @@ func TestAcc_AccountRole_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t CheckDestroy: acc.CheckDestroy(t, resources.AccountRole), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -230,7 +230,7 @@ func TestAcc_AccountRole_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: accountRoleBasicConfig(id.Name(), comment), Check: resource.ComposeAggregateTestCheckFunc( @@ -254,7 +254,7 @@ func TestAcc_AccountRole_WithQuotedName(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.AccountRole), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -269,7 +269,7 @@ func TestAcc_AccountRole_WithQuotedName(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: accountRoleBasicConfig(quotedId, comment), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/alert_acceptance_test.go b/pkg/resources/alert_acceptance_test.go index 6392543f4b..f038a64257 100644 --- a/pkg/resources/alert_acceptance_test.go +++ b/pkg/resources/alert_acceptance_test.go @@ -216,7 +216,7 @@ func TestAcc_Alert_Issue3117(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Alert), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -229,7 +229,7 @@ func TestAcc_Alert_Issue3117(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: alertIssue3117Config(id, acc.TestClient().Ids.WarehouseId(), "test_alert"), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/api_authentication_integration_with_authorization_code_grant_acceptance_test.go b/pkg/resources/api_authentication_integration_with_authorization_code_grant_acceptance_test.go index 57012b3902..d8595cb796 100644 --- a/pkg/resources/api_authentication_integration_with_authorization_code_grant_acceptance_test.go +++ b/pkg/resources/api_authentication_integration_with_authorization_code_grant_acceptance_test.go @@ -271,7 +271,7 @@ func TestAcc_ApiAuthenticationIntegrationWithAuthorizationCodeGrant_migrateFromV CheckDestroy: acc.CheckDestroy(t, resources.ApiAuthenticationIntegrationWithAuthorizationCodeGrant), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -284,7 +284,7 @@ func TestAcc_ApiAuthenticationIntegrationWithAuthorizationCodeGrant_migrateFromV ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: apiAuthenticationIntegrationWithAuthorizationCodeGrantBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -307,7 +307,7 @@ func TestAcc_ApiAuthenticationIntegrationWithAuthorizationCodeGrant_WithQuotedNa CheckDestroy: acc.CheckDestroy(t, resources.ApiAuthenticationIntegrationWithAuthorizationCodeGrant), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -322,7 +322,7 @@ func TestAcc_ApiAuthenticationIntegrationWithAuthorizationCodeGrant_WithQuotedNa ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: apiAuthenticationIntegrationWithAuthorizationCodeGrantBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/api_authentication_integration_with_client_credentials_acceptance_test.go b/pkg/resources/api_authentication_integration_with_client_credentials_acceptance_test.go index f300ba22a0..1501ca5386 100644 --- a/pkg/resources/api_authentication_integration_with_client_credentials_acceptance_test.go +++ b/pkg/resources/api_authentication_integration_with_client_credentials_acceptance_test.go @@ -264,7 +264,7 @@ func TestAcc_ApiAuthenticationIntegrationWithClientCredentials_migrateFromV0941_ CheckDestroy: acc.CheckDestroy(t, resources.ApiAuthenticationIntegrationWithClientCredentials), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -277,7 +277,7 @@ func TestAcc_ApiAuthenticationIntegrationWithClientCredentials_migrateFromV0941_ ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: apiAuthenticationIntegrationWithClientCredentialsBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -300,7 +300,7 @@ func TestAcc_ApiAuthenticationIntegrationWithClientCredentials_WithQuotedName(t CheckDestroy: acc.CheckDestroy(t, resources.ApiAuthenticationIntegrationWithClientCredentials), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -315,7 +315,7 @@ func TestAcc_ApiAuthenticationIntegrationWithClientCredentials_WithQuotedName(t ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: apiAuthenticationIntegrationWithClientCredentialsBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/api_authentication_integration_with_jwt_bearer_acceptance_test.go b/pkg/resources/api_authentication_integration_with_jwt_bearer_acceptance_test.go index 4b97df6ac8..78a896334f 100644 --- a/pkg/resources/api_authentication_integration_with_jwt_bearer_acceptance_test.go +++ b/pkg/resources/api_authentication_integration_with_jwt_bearer_acceptance_test.go @@ -232,7 +232,7 @@ func TestAcc_ApiAuthenticationIntegrationWithJwtBearer_migrateFromV0941_ensureSm CheckDestroy: acc.CheckDestroy(t, resources.ApiAuthenticationIntegrationWithJwtBearer), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -245,7 +245,7 @@ func TestAcc_ApiAuthenticationIntegrationWithJwtBearer_migrateFromV0941_ensureSm ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: apiAuthenticationIntegrationWithJwtBearerBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -270,7 +270,7 @@ func TestAcc_ApiAuthenticationIntegrationWithJwtBearer_IdentifierQuotingDiffSupp CheckDestroy: acc.CheckDestroy(t, resources.ApiAuthenticationIntegrationWithJwtBearer), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -285,7 +285,7 @@ func TestAcc_ApiAuthenticationIntegrationWithJwtBearer_IdentifierQuotingDiffSupp ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: apiAuthenticationIntegrationWithJwtBearerBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/database_acceptance_test.go b/pkg/resources/database_acceptance_test.go index 87eefa614e..d6a5a35003 100644 --- a/pkg/resources/database_acceptance_test.go +++ b/pkg/resources/database_acceptance_test.go @@ -980,7 +980,7 @@ func TestAcc_Database_UpgradeWithTheSameFieldsAsInTheOldOne(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Database), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1046,7 +1046,7 @@ func TestAcc_Database_UpgradeWithDataRetentionSet(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Database), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1110,7 +1110,7 @@ func TestAcc_Database_WithReplication(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Database), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1128,7 +1128,7 @@ func TestAcc_Database_WithReplication(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: databaseStateUpgraderWithReplicationNew(id, secondaryAccountIdentifier), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1271,7 +1271,7 @@ func TestAcc_Database_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t *t CheckDestroy: acc.CheckDestroy(t, resources.Database), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1284,7 +1284,7 @@ func TestAcc_Database_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t *t ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: databaseConfigBasic(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -1321,7 +1321,7 @@ func TestAcc_Database_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Database), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1338,7 +1338,7 @@ func TestAcc_Database_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: databaseConfigBasicWithExternalVolumeAndCatalog(quotedId, quotedExternalVolumeId, quotedCatalogId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/database_role_acceptance_test.go b/pkg/resources/database_role_acceptance_test.go index a75e20c176..11b559eefe 100644 --- a/pkg/resources/database_role_acceptance_test.go +++ b/pkg/resources/database_role_acceptance_test.go @@ -161,7 +161,7 @@ func TestAcc_DatabaseRole_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId( }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -174,7 +174,7 @@ func TestAcc_DatabaseRole_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId( ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, databaseRoleModelWithComment), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -206,7 +206,7 @@ func TestAcc_DatabaseRole_IdentifierQuotingDiffSuppression(t *testing.T) { }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -222,7 +222,7 @@ func TestAcc_DatabaseRole_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, databaseRoleModelWithComment), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/external_function_acceptance_test.go b/pkg/resources/external_function_acceptance_test.go index 325705b597..61b37e0b58 100644 --- a/pkg/resources/external_function_acceptance_test.go +++ b/pkg/resources/external_function_acceptance_test.go @@ -239,7 +239,7 @@ func TestAcc_ExternalFunction_migrateFromVersion085(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -292,7 +292,7 @@ func TestAcc_ExternalFunction_migrateFromVersion085_issue2694_previousValuePrese Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -337,7 +337,7 @@ func TestAcc_ExternalFunction_migrateFromVersion085_issue2694_previousValueRemov Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -418,7 +418,7 @@ func TestAcc_ExternalFunction_HeaderParsing(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.ExternalFunction), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.93.0", @@ -440,7 +440,7 @@ func TestAcc_ExternalFunction_HeaderParsing(t *testing.T) { ExpectNonEmptyPlan: true, }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalFunctionConfigIssueCurlyHeader(id), Check: resource.ComposeTestCheckFunc( @@ -588,7 +588,7 @@ func TestAcc_ExternalFunction_EnsureSmoothResourceIdMigrationToV0950(t *testing. CheckDestroy: acc.CheckDestroy(t, resources.ExternalFunction), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -601,7 +601,7 @@ func TestAcc_ExternalFunction_EnsureSmoothResourceIdMigrationToV0950(t *testing. ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalFunctionConfigWithMoreArguments(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( @@ -662,7 +662,7 @@ func TestAcc_ExternalFunction_EnsureSmoothResourceIdMigrationToV0950_WithoutArgu CheckDestroy: acc.CheckDestroy(t, resources.ExternalFunction), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -675,7 +675,7 @@ func TestAcc_ExternalFunction_EnsureSmoothResourceIdMigrationToV0950_WithoutArgu ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalFunctionConfigWithoutArguments(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/external_oauth_integration_acceptance_test.go b/pkg/resources/external_oauth_integration_acceptance_test.go index e9e278a2cb..b29b9de971 100644 --- a/pkg/resources/external_oauth_integration_acceptance_test.go +++ b/pkg/resources/external_oauth_integration_acceptance_test.go @@ -773,7 +773,7 @@ func TestAcc_ExternalOauthIntegration_migrateFromVersion092_withRsaPublicKeysAnd Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -800,7 +800,7 @@ func TestAcc_ExternalOauthIntegration_migrateFromVersion092_withRsaPublicKeysAnd ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalOauthIntegrationWithRsaPublicKeysAndBlockedRolesListv093(id.Name(), issuer, rsaKey, role.Name), Check: resource.ComposeAggregateTestCheckFunc( @@ -891,7 +891,7 @@ func TestAcc_ExternalOauthIntegration_migrateFromVersion092_withJwsKeysUrlAndAll Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -918,7 +918,7 @@ func TestAcc_ExternalOauthIntegration_migrateFromVersion092_withJwsKeysUrlAndAll ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalOauthIntegrationWithJwsKeysUrlAndAllowedRolesListv093(id.Name(), issuer, role.Name), Check: resource.ComposeAggregateTestCheckFunc( @@ -992,7 +992,7 @@ func TestAcc_ExternalOauthIntegration_migrateFromV0941_ensureSmoothUpgradeWithNe CheckDestroy: acc.CheckDestroy(t, resources.ExternalOauthSecurityIntegration), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1005,7 +1005,7 @@ func TestAcc_ExternalOauthIntegration_migrateFromV0941_ensureSmoothUpgradeWithNe ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalOauthIntegrationBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -1028,7 +1028,7 @@ func TestAcc_ExternalOauthIntegration_WithQuotedName(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.ExternalOauthSecurityIntegration), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1043,7 +1043,7 @@ func TestAcc_ExternalOauthIntegration_WithQuotedName(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalOauthIntegrationBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/function_acceptance_test.go b/pkg/resources/function_acceptance_test.go index d5c1ddc54d..7000d713c1 100644 --- a/pkg/resources/function_acceptance_test.go +++ b/pkg/resources/function_acceptance_test.go @@ -203,7 +203,7 @@ func TestAcc_Function_migrateFromVersion085(t *testing.T) { // Added as subtask SNOW-1057066 to SNOW-926148. Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -351,7 +351,7 @@ func TestAcc_Function_EnsureSmoothResourceIdMigrationToV0950(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Function), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -364,7 +364,7 @@ func TestAcc_Function_EnsureSmoothResourceIdMigrationToV0950(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: functionConfigWithMoreArguments(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( @@ -413,7 +413,7 @@ func TestAcc_Function_EnsureSmoothResourceIdMigrationToV0950_WithoutArguments(t CheckDestroy: acc.CheckDestroy(t, resources.Function), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -426,7 +426,7 @@ func TestAcc_Function_EnsureSmoothResourceIdMigrationToV0950_WithoutArguments(t ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: functionConfigWithoutArguments(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/grant_account_role_acceptance_test.go b/pkg/resources/grant_account_role_acceptance_test.go index bc8a1a2a8b..5591a26889 100644 --- a/pkg/resources/grant_account_role_acceptance_test.go +++ b/pkg/resources/grant_account_role_acceptance_test.go @@ -103,7 +103,7 @@ func TestAcc_GrantAccountRole_migrateFromV0941_ensureSmoothUpgradeWithNewResourc }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -116,7 +116,7 @@ func TestAcc_GrantAccountRole_migrateFromV0941_ensureSmoothUpgradeWithNewResourc ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantAccountRoleBasicConfig(roleName.Name(), parentRoleName.Name()), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -166,7 +166,7 @@ func TestAcc_GrantAccountRole_IdentifierQuotingDiffSuppression(t *testing.T) { }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -177,7 +177,7 @@ func TestAcc_GrantAccountRole_IdentifierQuotingDiffSuppression(t *testing.T) { Config: grantAccountRoleBasicConfig(quotedRoleId, quotedParentRoleId), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantAccountRoleBasicConfig(quotedRoleId, quotedParentRoleId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/grant_application_role_acceptance_test.go b/pkg/resources/grant_application_role_acceptance_test.go index 3f5981d97b..fa9281f397 100644 --- a/pkg/resources/grant_application_role_acceptance_test.go +++ b/pkg/resources/grant_application_role_acceptance_test.go @@ -140,7 +140,7 @@ func TestAcc_GrantApplicationRole_migrateFromV0941_ensureSmoothUpgradeWithNewRes }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -153,7 +153,7 @@ func TestAcc_GrantApplicationRole_migrateFromV0941_ensureSmoothUpgradeWithNewRes ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantApplicationRoleBasicConfig(fmt.Sprintf(`\"%s\".\"%s\"`, appRoleId.DatabaseName(), appRoleId.Name()), parentRoleId.Name()), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -202,7 +202,7 @@ func TestAcc_GrantApplicationRole_IdentifierQuotingDiffSuppression(t *testing.T) }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -213,7 +213,7 @@ func TestAcc_GrantApplicationRole_IdentifierQuotingDiffSuppression(t *testing.T) Config: grantApplicationRoleBasicConfig(unquotedApplicationRoleId, quotedParentRoleId), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantApplicationRoleBasicConfig(unquotedApplicationRoleId, quotedParentRoleId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/grant_database_role_acceptance_test.go b/pkg/resources/grant_database_role_acceptance_test.go index 467ac339e6..2edefbe0ab 100644 --- a/pkg/resources/grant_database_role_acceptance_test.go +++ b/pkg/resources/grant_database_role_acceptance_test.go @@ -265,7 +265,7 @@ func TestAcc_GrantDatabaseRole_migrateFromV0941_ensureSmoothUpgradeWithNewResour }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -278,7 +278,7 @@ func TestAcc_GrantDatabaseRole_migrateFromV0941_ensureSmoothUpgradeWithNewResour ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantDatabaseRoleBasicConfigQuoted(databaseId.Name(), roleId.Name(), parentRoleId.Name()), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -355,7 +355,7 @@ func TestAcc_GrantDatabaseRole_IdentifierQuotingDiffSuppression(t *testing.T) { }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -370,7 +370,7 @@ func TestAcc_GrantDatabaseRole_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantDatabaseRoleBasicConfigUnquoted(databaseId.Name(), roleId.Name(), parentRoleId.Name()), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/grant_ownership_acceptance_test.go b/pkg/resources/grant_ownership_acceptance_test.go index 037acecb47..17c0988979 100644 --- a/pkg/resources/grant_ownership_acceptance_test.go +++ b/pkg/resources/grant_ownership_acceptance_test.go @@ -1360,7 +1360,7 @@ func TestAcc_GrantOwnership_migrateFromV0941_ensureSmoothUpgradeWithNewResourceI }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1373,7 +1373,7 @@ func TestAcc_GrantOwnership_migrateFromV0941_ensureSmoothUpgradeWithNewResourceI ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantOwnershipOnTableBasicConfig(acc.TestDatabaseName, acc.TestSchemaName, tableId.Name(), accountRoleId.Name(), escapedFullyQualifiedName), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1436,7 +1436,7 @@ func TestAcc_GrantOwnership_IdentifierQuotingDiffSuppression(t *testing.T) { }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1450,7 +1450,7 @@ func TestAcc_GrantOwnership_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantOwnershipOnTableBasicConfigWithManagedDatabaseAndSchema(databaseId.Name(), schemaId.Name(), tableId.Name(), accountRoleId.Name(), unescapedFullyQualifiedName), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/grant_privileges_to_account_role_acceptance_test.go b/pkg/resources/grant_privileges_to_account_role_acceptance_test.go index 47f4c34ccc..0d359a4cfb 100644 --- a/pkg/resources/grant_privileges_to_account_role_acceptance_test.go +++ b/pkg/resources/grant_privileges_to_account_role_acceptance_test.go @@ -1750,7 +1750,7 @@ func TestAcc_GrantPrivilegesToAccountRole_migrateFromV0941_ensureSmoothUpgradeWi }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1763,7 +1763,7 @@ func TestAcc_GrantPrivilegesToAccountRole_migrateFromV0941_ensureSmoothUpgradeWi ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToAccountRoleBasicConfig(accountRoleId.Name(), accountRoleId.Name(), quotedSchemaId), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1814,7 +1814,7 @@ func TestAcc_GrantPrivilegesToAccountRole_IdentifierQuotingDiffSuppression(t *te }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1829,7 +1829,7 @@ func TestAcc_GrantPrivilegesToAccountRole_IdentifierQuotingDiffSuppression(t *te ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToAccountRoleBasicConfig(accountRoleId.Name(), unquotedAccountRoleId, unquotedSchemaId), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1917,7 +1917,7 @@ func TestAcc_GrantPrivilegesToAccountRole_OnFutureModels_issue3050(t *testing.T) CheckDestroy: acc.CheckAccountRolePrivilegesRevoked(t), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.95.0", @@ -1928,7 +1928,7 @@ func TestAcc_GrantPrivilegesToAccountRole_OnFutureModels_issue3050(t *testing.T) ExpectNonEmptyPlan: true, }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToAccountRoleOnFutureInDatabaseConfig(accountRoleName, []string{"USAGE"}, sdk.PluralObjectTypeModels, databaseName), }, diff --git a/pkg/resources/grant_privileges_to_database_role_acceptance_test.go b/pkg/resources/grant_privileges_to_database_role_acceptance_test.go index da535e946e..a2a64e7248 100644 --- a/pkg/resources/grant_privileges_to_database_role_acceptance_test.go +++ b/pkg/resources/grant_privileges_to_database_role_acceptance_test.go @@ -1388,7 +1388,7 @@ func TestAcc_GrantPrivilegesToDatabaseRole_migrateFromV0941_ensureSmoothUpgradeW }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1401,7 +1401,7 @@ func TestAcc_GrantPrivilegesToDatabaseRole_migrateFromV0941_ensureSmoothUpgradeW ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToDatabaseRoleBasicConfig(acc.TestClient().Ids.DatabaseId().Name(), databaseRoleId.Name(), quotedDatabaseRoleId, quotedSchemaId), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1453,7 +1453,7 @@ func TestAcc_GrantPrivilegesToDatabaseRole_IdentifierQuotingDiffSuppression(t *t }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1468,7 +1468,7 @@ func TestAcc_GrantPrivilegesToDatabaseRole_IdentifierQuotingDiffSuppression(t *t ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToDatabaseRoleBasicConfig(acc.TestClient().Ids.DatabaseId().Name(), databaseRoleId.Name(), unquotedDatabaseRoleId, unquotedSchemaId), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1502,7 +1502,7 @@ func TestAcc_GrantPrivilegesToDatabaseRole_OnFutureModels_issue3050(t *testing.T CheckDestroy: acc.CheckAccountRolePrivilegesRevoked(t), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.95.0", @@ -1513,7 +1513,7 @@ func TestAcc_GrantPrivilegesToDatabaseRole_OnFutureModels_issue3050(t *testing.T ExpectNonEmptyPlan: true, }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToDatabaseRoleOnFutureInDatabaseConfig(databaseRoleId, []string{"USAGE"}, sdk.PluralObjectTypeModels, databaseName), }, diff --git a/pkg/resources/grant_privileges_to_share_acceptance_test.go b/pkg/resources/grant_privileges_to_share_acceptance_test.go index 32099e8cff..8ce187746f 100644 --- a/pkg/resources/grant_privileges_to_share_acceptance_test.go +++ b/pkg/resources/grant_privileges_to_share_acceptance_test.go @@ -721,7 +721,7 @@ func TestAcc_GrantPrivilegesToShare_migrateFromV0941_ensureSmoothUpgradeWithNewR }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -734,7 +734,7 @@ func TestAcc_GrantPrivilegesToShare_migrateFromV0941_ensureSmoothUpgradeWithNewR ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToShareBasicConfig(databaseId.Name(), shareId.Name()), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -785,7 +785,7 @@ func TestAcc_GrantPrivilegesToShare_IdentifierQuotingDiffSuppression(t *testing. }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -796,7 +796,7 @@ func TestAcc_GrantPrivilegesToShare_IdentifierQuotingDiffSuppression(t *testing. Config: grantPrivilegesToShareBasicConfig(quotedDatabaseId, quotedShareId), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToShareBasicConfig(quotedDatabaseId, quotedShareId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/masking_policy_acceptance_test.go b/pkg/resources/masking_policy_acceptance_test.go index df08428418..a11f21a0b6 100644 --- a/pkg/resources/masking_policy_acceptance_test.go +++ b/pkg/resources/masking_policy_acceptance_test.go @@ -413,7 +413,7 @@ func TestAcc_MaskingPolicy_migrateFromVersion_0_94_1(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -427,7 +427,7 @@ func TestAcc_MaskingPolicy_migrateFromVersion_0_94_1(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigDirectory: acc.ConfigurationDirectory("TestAcc_MaskingPolicy/basic"), ConfigVariables: tfconfig.ConfigVariablesFromModel(t, policyModel), @@ -572,7 +572,7 @@ func TestAcc_MaskingPolicy_migrateFromVersion_0_95_0(t *testing.T) { PreCheck: func() { acc.TestAccPreCheck(t) }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.95.0", @@ -597,7 +597,7 @@ func TestAcc_MaskingPolicy_migrateFromVersion_0_95_0(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigDirectory: acc.ConfigurationDirectory("TestAcc_MaskingPolicy/complete"), ConfigVariables: tfconfig.ConfigVariablesFromModel(t, policyModel), diff --git a/pkg/resources/network_policy_acceptance_test.go b/pkg/resources/network_policy_acceptance_test.go index 96cde7161a..35c514f306 100644 --- a/pkg/resources/network_policy_acceptance_test.go +++ b/pkg/resources/network_policy_acceptance_test.go @@ -479,7 +479,7 @@ func TestAcc_NetworkPolicy_Issue2236(t *testing.T) { // Identifier quoting mismatch (no diff suppression) ExpectNonEmptyPlan: true, PreConfig: func() { - acc.SetV097CompatibleConfigPathEnv(t)() + acc.SetV097CompatibleConfigPathEnvFunc(t)() acc.TestClient().NetworkRule.CreateWithIdentifier(t, allowedNetworkRuleId) acc.TestClient().NetworkRule.CreateWithIdentifier(t, allowedNetworkRuleId2) acc.TestClient().NetworkRule.CreateWithIdentifier(t, blockedNetworkRuleId) @@ -503,7 +503,7 @@ func TestAcc_NetworkPolicy_Issue2236(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: networkPolicyConfigWithNetworkRules( id.Name(), @@ -556,7 +556,7 @@ func TestAcc_NetworkPolicy_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId CheckDestroy: acc.CheckDestroy(t, resources.NetworkPolicy), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -569,7 +569,7 @@ func TestAcc_NetworkPolicy_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: networkPolicyConfigBasic(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -592,7 +592,7 @@ func TestAcc_NetworkPolicy_WithQuotedName(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.NetworkPolicy), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -607,7 +607,7 @@ func TestAcc_NetworkPolicy_WithQuotedName(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: networkPolicyConfigBasic(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/network_rule_acceptance_test.go b/pkg/resources/network_rule_acceptance_test.go index c87c2f4914..745242acf7 100644 --- a/pkg/resources/network_rule_acceptance_test.go +++ b/pkg/resources/network_rule_acceptance_test.go @@ -134,7 +134,7 @@ func TestAcc_NetworkRule_migrateFromVersion_0_94_1(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -148,7 +148,7 @@ func TestAcc_NetworkRule_migrateFromVersion_0_94_1(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: networkRuleIpv4(id.Name(), acc.TestDatabaseName, acc.TestSchemaName), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/notification_integration_acceptance_test.go b/pkg/resources/notification_integration_acceptance_test.go index 22fc3622f2..d85479dfdb 100644 --- a/pkg/resources/notification_integration_acceptance_test.go +++ b/pkg/resources/notification_integration_acceptance_test.go @@ -232,7 +232,7 @@ func TestAcc_NotificationIntegration_migrateFromVersion085(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.NotificationIntegration), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -247,7 +247,7 @@ func TestAcc_NotificationIntegration_migrateFromVersion085(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: googleAutoConfigWithoutDirection(accName, gcpPubsubSubscriptionName), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -278,7 +278,7 @@ func TestAcc_NotificationIntegration_migrateFromVersion085_explicitType(t *testi CheckDestroy: acc.CheckDestroy(t, resources.NotificationIntegration), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -291,7 +291,7 @@ func TestAcc_NotificationIntegration_migrateFromVersion085_explicitType(t *testi ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: googleAutoConfig(accName, gcpPubsubSubscriptionName), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/oauth_integration_for_custom_clients_acceptance_test.go b/pkg/resources/oauth_integration_for_custom_clients_acceptance_test.go index 43d5763403..2ccd93a1c5 100644 --- a/pkg/resources/oauth_integration_for_custom_clients_acceptance_test.go +++ b/pkg/resources/oauth_integration_for_custom_clients_acceptance_test.go @@ -682,7 +682,7 @@ func TestAcc_OauthIntegrationForCustomClients_migrateFromV0941_ensureSmoothUpgra CheckDestroy: acc.CheckDestroy(t, resourcenames.OauthIntegrationForCustomClients), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -695,7 +695,7 @@ func TestAcc_OauthIntegrationForCustomClients_migrateFromV0941_ensureSmoothUpgra ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: oauthIntegrationForCustomClientsBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -718,7 +718,7 @@ func TestAcc_OauthIntegrationForCustomClients_WithQuotedName(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resourcenames.OauthIntegrationForCustomClients), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -733,7 +733,7 @@ func TestAcc_OauthIntegrationForCustomClients_WithQuotedName(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: oauthIntegrationForCustomClientsBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/oauth_integration_for_partner_applications_acceptance_test.go b/pkg/resources/oauth_integration_for_partner_applications_acceptance_test.go index 99f15f2d90..10156dab1f 100644 --- a/pkg/resources/oauth_integration_for_partner_applications_acceptance_test.go +++ b/pkg/resources/oauth_integration_for_partner_applications_acceptance_test.go @@ -687,7 +687,7 @@ func TestAcc_OauthIntegrationForPartnerApplications_migrateFromV0941_ensureSmoot CheckDestroy: acc.CheckDestroy(t, resources.OauthIntegrationForPartnerApplications), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -700,7 +700,7 @@ func TestAcc_OauthIntegrationForPartnerApplications_migrateFromV0941_ensureSmoot ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: oauthIntegrationForPartnerApplicationsBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -723,7 +723,7 @@ func TestAcc_OauthIntegrationForPartnerApplications_WithQuotedName(t *testing.T) CheckDestroy: acc.CheckDestroy(t, resources.OauthIntegrationForPartnerApplications), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -738,7 +738,7 @@ func TestAcc_OauthIntegrationForPartnerApplications_WithQuotedName(t *testing.T) ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: oauthIntegrationForPartnerApplicationsBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/password_policy_acceptance_test.go b/pkg/resources/password_policy_acceptance_test.go index a42c0dff9f..8a9dceca28 100644 --- a/pkg/resources/password_policy_acceptance_test.go +++ b/pkg/resources/password_policy_acceptance_test.go @@ -197,7 +197,7 @@ func TestAcc_PasswordPolicy_migrateFromVersion_0_94_1(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -211,7 +211,7 @@ func TestAcc_PasswordPolicy_migrateFromVersion_0_94_1(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: passwordPolicyBasicConfig(id), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/procedure_acceptance_test.go b/pkg/resources/procedure_acceptance_test.go index 89b2e1f4cf..ec6aa102d7 100644 --- a/pkg/resources/procedure_acceptance_test.go +++ b/pkg/resources/procedure_acceptance_test.go @@ -212,7 +212,7 @@ func TestAcc_Procedure_migrateFromVersion085(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -277,7 +277,7 @@ func TestAcc_Procedure_proveArgsPermanentDiff(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Procedure), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.89.0", @@ -294,7 +294,7 @@ func TestAcc_Procedure_proveArgsPermanentDiff(t *testing.T) { }, }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: sqlProcedureConfigArgsPermanentDiff(acc.TestDatabaseName, acc.TestSchemaName, name), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -322,7 +322,7 @@ func TestAcc_Procedure_returnTypePermanentDiff(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Procedure), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.89.0", @@ -339,7 +339,7 @@ func TestAcc_Procedure_returnTypePermanentDiff(t *testing.T) { }, }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: sqlProcedureConfigReturnTypePermanentDiff(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( @@ -413,7 +413,7 @@ func TestAcc_Procedure_EnsureSmoothResourceIdMigrationToV0950(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Procedure), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -426,7 +426,7 @@ func TestAcc_Procedure_EnsureSmoothResourceIdMigrationToV0950(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: procedureConfigWithMoreArguments(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( @@ -479,7 +479,7 @@ func TestAcc_Procedure_EnsureSmoothResourceIdMigrationToV0950_WithoutArguments(t CheckDestroy: acc.CheckDestroy(t, resources.Function), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -492,7 +492,7 @@ func TestAcc_Procedure_EnsureSmoothResourceIdMigrationToV0950_WithoutArguments(t ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: procedureConfigWithoutArguments(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( @@ -532,7 +532,7 @@ func TestAcc_Procedure_EnsureSmoothResourceIdMigrationToV0950_ArgumentSynonyms(t CheckDestroy: acc.CheckDestroy(t, resources.Procedure), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -545,7 +545,7 @@ func TestAcc_Procedure_EnsureSmoothResourceIdMigrationToV0950_ArgumentSynonyms(t ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: procedureConfigWithArgumentSynonyms(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/resource_monitor_acceptance_test.go b/pkg/resources/resource_monitor_acceptance_test.go index e4888bdbf3..1fd27c76a2 100644 --- a/pkg/resources/resource_monitor_acceptance_test.go +++ b/pkg/resources/resource_monitor_acceptance_test.go @@ -529,7 +529,7 @@ func TestAcc_ResourceMonitor_Issue1990_RemovingResourceMonitorOutsideOfTerraform Steps: []resource.TestStep{ // Create resource monitor { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.69.0", @@ -565,7 +565,7 @@ func TestAcc_ResourceMonitor_Issue1990_RemovingResourceMonitorOutsideOfTerraform }, // Same configuration, but it's the latest version of the provider (0.96.0 and above) { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, configModel), }, @@ -601,7 +601,7 @@ func TestAcc_ResourceMonitor_Issue_TimestampInfinitePlan(t *testing.T) { Steps: []resource.TestStep{ // Create resource monitor without the timestamps { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.90.0", @@ -644,7 +644,7 @@ func TestAcc_ResourceMonitor_Issue_TimestampInfinitePlan(t *testing.T) { }, // Create resource monitor without the timestamps { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, configModel), }, @@ -682,7 +682,7 @@ func TestAcc_ResourceMonitor_Issue1500_CreatingWithOnlyTriggers(t *testing.T) { Steps: []resource.TestStep{ // Create resource monitor with only triggers (old version) { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.90.0", @@ -694,7 +694,7 @@ func TestAcc_ResourceMonitor_Issue1500_CreatingWithOnlyTriggers(t *testing.T) { }, // Create resource monitor with only triggers (the latest version) { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, configModel), ExpectError: regexp.MustCompile("due to Snowflake limiltations you cannot create Resource Monitor with only triggers set"), @@ -736,7 +736,7 @@ func TestAcc_ResourceMonitor_Issue1500_AlteringWithOnlyTriggers(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.ResourceMonitor), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.90.0", @@ -770,7 +770,7 @@ func TestAcc_ResourceMonitor_Issue1500_AlteringWithOnlyTriggers(t *testing.T) { }, // Upgrade to the latest version { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, configModelWithCreditQuota), }, @@ -906,7 +906,7 @@ func TestAcc_ResourceMonitor_SetForWarehouse(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.ResourceMonitor), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.90.0", @@ -926,7 +926,7 @@ resource "snowflake_resource_monitor" "test" { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: fmt.Sprintf(` resource "snowflake_resource_monitor" "test" { diff --git a/pkg/resources/row_access_policy_acceptance_test.go b/pkg/resources/row_access_policy_acceptance_test.go index df84179e6c..baa268e701 100644 --- a/pkg/resources/row_access_policy_acceptance_test.go +++ b/pkg/resources/row_access_policy_acceptance_test.go @@ -208,7 +208,7 @@ func TestAcc_RowAccessPolicy_Issue2053(t *testing.T) { PreCheck: func() { acc.TestAccPreCheck(t) }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.95.0", @@ -229,7 +229,7 @@ func TestAcc_RowAccessPolicy_Issue2053(t *testing.T) { ExpectNonEmptyPlan: true, }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigDirectory: acc.ConfigurationDirectory("TestAcc_RowAccessPolicy/basic"), ConfigVariables: tfconfig.ConfigVariablesFromModel(t, policyModel), @@ -427,7 +427,7 @@ func TestAcc_RowAccessPolicy_migrateFromVersion_0_95_0_LowercaseArgName(t *testi PreCheck: func() { acc.TestAccPreCheck(t) }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.95.0", @@ -453,7 +453,7 @@ func TestAcc_RowAccessPolicy_migrateFromVersion_0_95_0_LowercaseArgName(t *testi ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigDirectory: acc.ConfigurationDirectory("TestAcc_RowAccessPolicy/basic"), ConfigVariables: tfconfig.ConfigVariablesFromModel(t, policyModel), @@ -509,7 +509,7 @@ func TestAcc_RowAccessPolicy_migrateFromVersion_0_95_0_UppercaseArgName(t *testi PreCheck: func() { acc.TestAccPreCheck(t) }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.95.0", @@ -535,7 +535,7 @@ func TestAcc_RowAccessPolicy_migrateFromVersion_0_95_0_UppercaseArgName(t *testi ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigDirectory: acc.ConfigurationDirectory("TestAcc_RowAccessPolicy/basic"), ConfigVariables: tfconfig.ConfigVariablesFromModel(t, policyModel), diff --git a/pkg/resources/saml2_integration_acceptance_test.go b/pkg/resources/saml2_integration_acceptance_test.go index 5640b13250..7895c135b3 100644 --- a/pkg/resources/saml2_integration_acceptance_test.go +++ b/pkg/resources/saml2_integration_acceptance_test.go @@ -1082,7 +1082,7 @@ func TestAcc_Saml2Integration_migrateFromV0941_ensureSmoothUpgradeWithNewResourc CheckDestroy: acc.CheckDestroy(t, resources.Saml2SecurityIntegration), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1095,7 +1095,7 @@ func TestAcc_Saml2Integration_migrateFromV0941_ensureSmoothUpgradeWithNewResourc ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: saml2IntegrationBasicConfig(id.Name(), cert), Check: resource.ComposeAggregateTestCheckFunc( @@ -1119,7 +1119,7 @@ func TestAcc_Saml2Integration_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Saml2SecurityIntegration), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1134,7 +1134,7 @@ func TestAcc_Saml2Integration_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: saml2IntegrationBasicConfig(quotedId, cert), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/schema_acceptance_test.go b/pkg/resources/schema_acceptance_test.go index 7bbc924478..0ce874fd60 100644 --- a/pkg/resources/schema_acceptance_test.go +++ b/pkg/resources/schema_acceptance_test.go @@ -465,7 +465,7 @@ func TestAcc_Schema_ManagePublicVersion_0_94_0(t *testing.T) { Steps: []resource.TestStep{ // PUBLIC can not be created in v0.93 { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.93.0", @@ -544,7 +544,7 @@ func TestAcc_Schema_ManagePublicVersion_0_94_1(t *testing.T) { Steps: []resource.TestStep{ // PUBLIC can not be created in v0.93 { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.93.0", @@ -555,7 +555,7 @@ func TestAcc_Schema_ManagePublicVersion_0_94_1(t *testing.T) { ExpectError: regexp.MustCompile("Error: error creating schema PUBLIC"), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: schemav094WithPipeExecutionPaused(name, db.ID().Name(), true), Check: resource.ComposeTestCheckFunc( @@ -961,7 +961,7 @@ func TestAcc_Schema_migrateFromVersion093WithoutManagedAccess(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.93.0", @@ -975,7 +975,7 @@ func TestAcc_Schema_migrateFromVersion093WithoutManagedAccess(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: schemav094(id.Name(), databaseId.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -1005,7 +1005,7 @@ func TestAcc_Schema_migrateFromVersion093(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.93.0", @@ -1023,7 +1023,7 @@ func TestAcc_Schema_migrateFromVersion093(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: schemav094WithManagedAccessAndDataRetentionTimeInDays(id.Name(), databaseId.Name(), true, 10), Check: resource.ComposeAggregateTestCheckFunc( @@ -1111,7 +1111,7 @@ func TestAcc_Schema_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t *tes CheckDestroy: acc.CheckDestroy(t, resources.Schema), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1124,7 +1124,7 @@ func TestAcc_Schema_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t *tes ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: schemaBasicConfig(id.DatabaseName(), id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -1157,7 +1157,7 @@ func TestAcc_Schema_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Schema), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1173,7 +1173,7 @@ func TestAcc_Schema_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: schemaBasicConfig(quotedDatabaseName, quotedName), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/scim_integration_acceptance_test.go b/pkg/resources/scim_integration_acceptance_test.go index 3769c65dfa..9989d9b99e 100644 --- a/pkg/resources/scim_integration_acceptance_test.go +++ b/pkg/resources/scim_integration_acceptance_test.go @@ -425,7 +425,7 @@ func TestAcc_ScimIntegration_migrateFromVersion092EnabledTrue(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -439,7 +439,7 @@ func TestAcc_ScimIntegration_migrateFromVersion092EnabledTrue(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: scimIntegrationv093(id.Name(), role.Name(), true, sdk.ScimSecurityIntegrationScimClientGeneric), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -475,7 +475,7 @@ func TestAcc_ScimIntegration_migrateFromVersion092EnabledFalse(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -489,7 +489,7 @@ func TestAcc_ScimIntegration_migrateFromVersion092EnabledFalse(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: scimIntegrationv093(id.Name(), role.Name(), false, sdk.ScimSecurityIntegrationScimClientGeneric), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -518,7 +518,7 @@ func TestAcc_ScimIntegration_migrateFromVersion093HandleSyncPassword(t *testing. Steps: []resource.TestStep{ // create resource with v0.92 { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -552,7 +552,7 @@ func TestAcc_ScimIntegration_migrateFromVersion093HandleSyncPassword(t *testing. }, // check with newest version - the value in state was set to boolean default, so there should be no diff { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: scimIntegrationv093(id.Name(), role.Name(), true, sdk.ScimSecurityIntegrationScimClientAzure), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -602,7 +602,7 @@ func TestAcc_ScimIntegration_migrateFromV0941_ensureSmoothUpgradeWithNewResource CheckDestroy: acc.CheckDestroy(t, resources.ScimSecurityIntegration), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -615,7 +615,7 @@ func TestAcc_ScimIntegration_migrateFromV0941_ensureSmoothUpgradeWithNewResource ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: scimIntegrationBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -638,7 +638,7 @@ func TestAcc_ScimIntegration_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.ScimSecurityIntegration), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -653,7 +653,7 @@ func TestAcc_ScimIntegration_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: scimIntegrationBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/secondary_database_acceptance_test.go b/pkg/resources/secondary_database_acceptance_test.go index f551b44d5c..bec1f6faab 100644 --- a/pkg/resources/secondary_database_acceptance_test.go +++ b/pkg/resources/secondary_database_acceptance_test.go @@ -541,7 +541,7 @@ func TestAcc_SecondaryDatabase_migrateFromV0941_ensureSmoothUpgradeWithNewResour CheckDestroy: acc.CheckDestroy(t, resources.SecondaryDatabase), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -554,7 +554,7 @@ func TestAcc_SecondaryDatabase_migrateFromV0941_ensureSmoothUpgradeWithNewResour ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: secondaryDatabaseConfigBasic(id.Name(), externalPrimaryId.FullyQualifiedName()), Check: resource.ComposeAggregateTestCheckFunc( @@ -593,7 +593,7 @@ func TestAcc_SecondaryDatabase_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.SecondaryDatabase), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -608,7 +608,7 @@ func TestAcc_SecondaryDatabase_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: secondaryDatabaseConfigBasic(quotedId, unquotedExternalPrimaryId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/shared_database_acceptance_test.go b/pkg/resources/shared_database_acceptance_test.go index 58a18cb6d7..0315e16bc6 100644 --- a/pkg/resources/shared_database_acceptance_test.go +++ b/pkg/resources/shared_database_acceptance_test.go @@ -306,7 +306,7 @@ func TestAcc_SharedDatabase_migrateFromV0941_ensureSmoothUpgradeWithNewResourceI CheckDestroy: acc.CheckDestroy(t, resources.SharedDatabase), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -319,7 +319,7 @@ func TestAcc_SharedDatabase_migrateFromV0941_ensureSmoothUpgradeWithNewResourceI ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: sharedDatabaseConfigBasic(id.Name(), externalShareId.FullyQualifiedName()), Check: resource.ComposeAggregateTestCheckFunc( @@ -357,7 +357,7 @@ func TestAcc_SharedDatabase_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.SharedDatabase), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -372,7 +372,7 @@ func TestAcc_SharedDatabase_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: sharedDatabaseConfigBasic(quotedId, unquotedExternalShareId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/streamlit_acceptance_test.go b/pkg/resources/streamlit_acceptance_test.go index 51647aaacd..c294e8798e 100644 --- a/pkg/resources/streamlit_acceptance_test.go +++ b/pkg/resources/streamlit_acceptance_test.go @@ -449,7 +449,7 @@ func TestAcc_Streamlit_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t * CheckDestroy: acc.CheckDestroy(t, resources.Streamlit), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -462,7 +462,7 @@ func TestAcc_Streamlit_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t * ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: streamlitBasicConfig(id, stage.ID(), "main_file"), Check: resource.ComposeAggregateTestCheckFunc( @@ -503,7 +503,7 @@ func TestAcc_Streamlit_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Streamlit), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -520,7 +520,7 @@ func TestAcc_Streamlit_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: streamlitBasicConfigWithRawIdentifierValues(quotedDatabaseName, quotedSchemaName, quotedName, stage.ID().Name(), "main_file"), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/table_acceptance_test.go b/pkg/resources/table_acceptance_test.go index 85a6ebbdfd..b327a0638e 100644 --- a/pkg/resources/table_acceptance_test.go +++ b/pkg/resources/table_acceptance_test.go @@ -1994,7 +1994,7 @@ func TestAcc_Table_migrateFromVersion_0_94_1(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -2008,7 +2008,7 @@ func TestAcc_Table_migrateFromVersion_0_94_1(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: tableConfig(id.Name(), id.DatabaseName(), id.SchemaName()), Check: resource.ComposeTestCheckFunc( @@ -2034,7 +2034,7 @@ func TestAcc_Table_SuppressQuotingOnDefaultSequence_issue2644(t *testing.T) { }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -2045,7 +2045,7 @@ func TestAcc_Table_SuppressQuotingOnDefaultSequence_issue2644(t *testing.T) { Config: tableConfigWithSequence(name, databaseName, schemaName), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: tableConfigWithSequence(name, databaseName, schemaName), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/table_constraint_acceptance_test.go b/pkg/resources/table_constraint_acceptance_test.go index d6e3556144..c6dba1f2d3 100644 --- a/pkg/resources/table_constraint_acceptance_test.go +++ b/pkg/resources/table_constraint_acceptance_test.go @@ -232,7 +232,7 @@ func TestAcc_Table_issue2535_newConstraint(t *testing.T) { CheckDestroy: nil, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.86.0", @@ -255,7 +255,7 @@ func TestAcc_Table_issue2535_newConstraint(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: tableConstraintUniqueConfigUsingTableId(accName, acc.TestDatabaseName, acc.TestSchemaName, "|"), ExpectError: regexp.MustCompile(`.*Expected SchemaObjectIdentifier identifier type, but got:.*`), @@ -284,7 +284,7 @@ func TestAcc_Table_issue2535_existingTable(t *testing.T) { Steps: []resource.TestStep{ // reference done by table.id in 0.85.0 { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -309,7 +309,7 @@ func TestAcc_Table_issue2535_existingTable(t *testing.T) { }, // fixed in the current version { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: tableConstraintUniqueConfigUsingFullyQualifiedName(accName, acc.TestDatabaseName, acc.TestSchemaName), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/user_acceptance_test.go b/pkg/resources/user_acceptance_test.go index 3505780123..538ca8d434 100644 --- a/pkg/resources/user_acceptance_test.go +++ b/pkg/resources/user_acceptance_test.go @@ -1350,7 +1350,7 @@ func TestAcc_User_migrateFromVersion094_noDefaultSecondaryRolesSet(t *testing.T) CheckDestroy: acc.CheckDestroy(t, resources.User), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1364,7 +1364,7 @@ func TestAcc_User_migrateFromVersion094_noDefaultSecondaryRolesSet(t *testing.T) ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, userModel), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1397,7 +1397,7 @@ func TestAcc_User_migrateFromVersion094_defaultSecondaryRolesSet(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.User), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1416,7 +1416,7 @@ resource "snowflake_user" "test" { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, userModelWithOptionAll), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1673,6 +1673,7 @@ func TestAcc_User_handleChangesToShowUsers_bcr202408_migration_bcr202407_enabled { PreConfig: func() { acc.TestClient().BcrBundles.EnableBcrBundle(t, "2024_07") + acc.SetV097CompatibleConfigPathEnvFunc(t)() }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { @@ -1689,6 +1690,7 @@ func TestAcc_User_handleChangesToShowUsers_bcr202408_migration_bcr202407_enabled { PreConfig: func() { acc.TestClient().BcrBundles.EnableBcrBundle(t, "2024_08") + acc.UnsetConfigPathEnvFunc(t)() }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, userModel), @@ -1728,7 +1730,8 @@ func TestAcc_User_handleChangesToShowUsers_bcr202408_migration_bcr202407_disable Source: "Snowflake-Labs/snowflake", }, }, - Config: config.FromModel(t, userModel), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + Config: config.FromModel(t, userModel), Check: assert.AssertThat(t, resourceassert.UserResource(t, userModel.ResourceReference()). HasAllDefaults(userId, sdk.SecondaryRolesOptionDefault), @@ -1737,6 +1740,7 @@ func TestAcc_User_handleChangesToShowUsers_bcr202408_migration_bcr202407_disable { PreConfig: func() { acc.TestClient().BcrBundles.EnableBcrBundle(t, "2024_08") + acc.UnsetConfigPathEnvFunc(t)() }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, userModel), diff --git a/pkg/resources/user_password_policy_attachment_acceptance_test.go b/pkg/resources/user_password_policy_attachment_acceptance_test.go index 192471ec6b..8ad11da6fe 100644 --- a/pkg/resources/user_password_policy_attachment_acceptance_test.go +++ b/pkg/resources/user_password_policy_attachment_acceptance_test.go @@ -82,7 +82,8 @@ func TestAcc_UserPasswordPolicyAttachment_gh3005(t *testing.T) { Steps: []resource.TestStep{ // CREATE { - Config: userPasswordPolicyAttachmentConfigV087(userName, acc.TestDatabaseName, acc.TestSchemaName, passwordPolicyName), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + Config: userPasswordPolicyAttachmentConfigV087(userName, acc.TestDatabaseName, acc.TestSchemaName, passwordPolicyName), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("snowflake_user_password_policy_attachment.ppa", "user_name", userName), resource.TestCheckResourceAttr("snowflake_user_password_policy_attachment.ppa", "password_policy_name", passwordPolicyId.FullyQualifiedName()), diff --git a/pkg/resources/view_acceptance_test.go b/pkg/resources/view_acceptance_test.go index 0417874815..65713fd647 100644 --- a/pkg/resources/view_acceptance_test.go +++ b/pkg/resources/view_acceptance_test.go @@ -1253,7 +1253,7 @@ func TestAcc_view_migrateFromVersion_0_94_1(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1270,7 +1270,7 @@ func TestAcc_view_migrateFromVersion_0_94_1(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigDirectory: acc.ConfigurationDirectory("TestAcc_View/basic"), ConfigVariables: viewConfig, diff --git a/pkg/resources/warehouse_acceptance_test.go b/pkg/resources/warehouse_acceptance_test.go index 16ee28db0c..09a09f7be0 100644 --- a/pkg/resources/warehouse_acceptance_test.go +++ b/pkg/resources/warehouse_acceptance_test.go @@ -1452,7 +1452,7 @@ func TestAcc_Warehouse_migrateFromVersion092_withWarehouseSize(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1466,7 +1466,7 @@ func TestAcc_Warehouse_migrateFromVersion092_withWarehouseSize(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigPlanChecks: resource.ConfigPlanChecks{ PreApply: []plancheck.PlanCheck{ @@ -1495,7 +1495,7 @@ func TestAcc_Warehouse_migrateFromVersion092_allFieldsFilledBeforeMigration(t *t Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1510,7 +1510,7 @@ func TestAcc_Warehouse_migrateFromVersion092_allFieldsFilledBeforeMigration(t *t ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseFullMigrationConfig(id.Name(), false), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1557,7 +1557,7 @@ func TestAcc_Warehouse_migrateFromVersion092_allFieldsFilledBeforeMigration_bool Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1574,7 +1574,7 @@ func TestAcc_Warehouse_migrateFromVersion092_allFieldsFilledBeforeMigration_bool }, // let's try to change the value of the parameter that was earlier a bool and now is a string { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigPlanChecks: resource.ConfigPlanChecks{ PreApply: []plancheck.PlanCheck{ @@ -1606,7 +1606,7 @@ func TestAcc_Warehouse_migrateFromVersion092_queryAccelerationMaxScaleFactor_sam Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1620,7 +1620,7 @@ func TestAcc_Warehouse_migrateFromVersion092_queryAccelerationMaxScaleFactor_sam ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseFullDefaultConfig(id.Name(), ""), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1654,7 +1654,7 @@ func TestAcc_Warehouse_migrateFromVersion092_queryAccelerationMaxScaleFactor_noI Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1668,7 +1668,7 @@ func TestAcc_Warehouse_migrateFromVersion092_queryAccelerationMaxScaleFactor_noI ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseFullDefaultConfigWithQueryAccelerationMaxScaleFactorRemoved(id.Name(), ""), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1702,7 +1702,7 @@ func TestAcc_Warehouse_migrateFromVersion092_queryAccelerationMaxScaleFactor_dif Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1716,7 +1716,7 @@ func TestAcc_Warehouse_migrateFromVersion092_queryAccelerationMaxScaleFactor_dif ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseFullDefaultConfigWithQueryAcceleration(id.Name(), "", true, 10), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1749,7 +1749,7 @@ func TestAcc_Warehouse_migrateFromVersion092_noConfigToFullConfig(t *testing.T) Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1763,7 +1763,7 @@ func TestAcc_Warehouse_migrateFromVersion092_noConfigToFullConfig(t *testing.T) ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseFullDefaultConfigWithQueryAcceleration(id.Name(), "", true, 8), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1806,7 +1806,7 @@ func TestAcc_Warehouse_migrateFromVersion092_defaultsRemoved(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1836,7 +1836,7 @@ func TestAcc_Warehouse_migrateFromVersion092_defaultsRemoved(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseWithSizeConfig(id.Name(), string(sdk.WarehouseSizeXSmall)), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1876,7 +1876,7 @@ func TestAcc_Warehouse_migrateFromVersion092_warehouseSizeCausingForceNew(t *tes Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1889,7 +1889,7 @@ func TestAcc_Warehouse_migrateFromVersion092_warehouseSizeCausingForceNew(t *tes ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseBasicConfig(id.Name()), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1916,7 +1916,7 @@ func TestAcc_Warehouse_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t * CheckDestroy: acc.CheckDestroy(t, resources.Warehouse), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1929,7 +1929,7 @@ func TestAcc_Warehouse_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t * ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -1952,7 +1952,7 @@ func TestAcc_Warehouse_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Warehouse), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnv(t), + PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1967,7 +1967,7 @@ func TestAcc_Warehouse_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnv(t), + PreConfig: acc.UnsetConfigPathEnvFunc(t), ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ From 795279c3196b608f4d9858163b22309873e69280 Mon Sep 17 00:00:00 2001 From: Jakub Michalak Date: Mon, 18 Nov 2024 09:42:30 +0100 Subject: [PATCH 07/10] Use set and unset in a local function --- pkg/acceptance/testing.go | 22 ++++------ pkg/provider/provider_acceptance_test.go | 2 +- pkg/resources/account_role_acceptance_test.go | 8 ++-- pkg/resources/alert_acceptance_test.go | 4 +- ...uthorization_code_grant_acceptance_test.go | 8 ++-- ...with_client_credentials_acceptance_test.go | 8 ++-- ...gration_with_jwt_bearer_acceptance_test.go | 8 ++-- pkg/resources/database_acceptance_test.go | 16 +++---- .../database_role_acceptance_test.go | 8 ++-- .../external_function_acceptance_test.go | 18 ++++---- ...ernal_oauth_integration_acceptance_test.go | 16 +++---- pkg/resources/function_acceptance_test.go | 10 ++--- .../grant_account_role_acceptance_test.go | 8 ++-- .../grant_application_role_acceptance_test.go | 8 ++-- .../grant_database_role_acceptance_test.go | 8 ++-- .../grant_ownership_acceptance_test.go | 8 ++-- ...vileges_to_account_role_acceptance_test.go | 12 ++--- ...ileges_to_database_role_acceptance_test.go | 12 ++--- ...ant_privileges_to_share_acceptance_test.go | 8 ++-- .../masking_policy_acceptance_test.go | 8 ++-- .../network_policy_acceptance_test.go | 12 ++--- pkg/resources/network_rule_acceptance_test.go | 4 +- ...otification_integration_acceptance_test.go | 8 ++-- ...tion_for_custom_clients_acceptance_test.go | 8 ++-- ...or_partner_applications_acceptance_test.go | 8 ++-- .../password_policy_acceptance_test.go | 4 +- pkg/resources/procedure_acceptance_test.go | 22 +++++----- .../resource_monitor_acceptance_test.go | 20 ++++----- .../row_access_policy_acceptance_test.go | 12 ++--- .../saml2_integration_acceptance_test.go | 8 ++-- pkg/resources/schema_acceptance_test.go | 22 +++++----- .../scim_integration_acceptance_test.go | 20 ++++----- .../secondary_database_acceptance_test.go | 8 ++-- .../shared_database_acceptance_test.go | 8 ++-- pkg/resources/streamlit_acceptance_test.go | 8 ++-- pkg/resources/table_acceptance_test.go | 8 ++-- .../table_constraint_acceptance_test.go | 8 ++-- pkg/resources/user_acceptance_test.go | 16 +++---- ...sword_policy_attachment_acceptance_test.go | 2 +- pkg/resources/view_acceptance_test.go | 4 +- pkg/resources/warehouse_acceptance_test.go | 44 +++++++++---------- 41 files changed, 225 insertions(+), 229 deletions(-) diff --git a/pkg/acceptance/testing.go b/pkg/acceptance/testing.go index 765abc5043..3896228d0b 100644 --- a/pkg/acceptance/testing.go +++ b/pkg/acceptance/testing.go @@ -211,21 +211,17 @@ func ExternalProviderWithExactVersion(version string) map[string]resource.Extern } } -// SetV097CompatibleConfigPathEnvFunc sets a new config path in a relevant env variable for a file that is compatible with v0.97. -func SetV097CompatibleConfigPathEnvFunc(t *testing.T) func() { +// SetV097CompatibleConfigPathEnv sets a new config path in a relevant env variable for a file that is compatible with v0.97. +func SetV097CompatibleConfigPathEnv(t *testing.T) { t.Helper() - return func() { - home, err := os.UserHomeDir() - require.NoError(t, err) - configPath := filepath.Join(home, ".snowflake", "config_v097_compatible") - t.Setenv(snowflakeenvs.ConfigPath, configPath) - } + home, err := os.UserHomeDir() + require.NoError(t, err) + configPath := filepath.Join(home, ".snowflake", "config_v097_compatible") + t.Setenv(snowflakeenvs.ConfigPath, configPath) } -// UnsetConfigPathEnvFunc unsets a config path env -func UnsetConfigPathEnvFunc(t *testing.T) func() { +// UnsetConfigPathEnv unsets a config path env +func UnsetConfigPathEnv(t *testing.T) { t.Helper() - return func() { - t.Setenv(snowflakeenvs.ConfigPath, "") - } + t.Setenv(snowflakeenvs.ConfigPath, "") } diff --git a/pkg/provider/provider_acceptance_test.go b/pkg/provider/provider_acceptance_test.go index 4a1763040d..0d0daf7b67 100644 --- a/pkg/provider/provider_acceptance_test.go +++ b/pkg/provider/provider_acceptance_test.go @@ -504,7 +504,7 @@ func TestAcc_Provider_triValueBoolean(t *testing.T) { }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: acc.ExternalProviderWithExactVersion("0.97.0"), Config: providerConfigWithClientStoreTemporaryCredential(testprofiles.Default, `true`), }, diff --git a/pkg/resources/account_role_acceptance_test.go b/pkg/resources/account_role_acceptance_test.go index 08c6625509..7fffe1456b 100644 --- a/pkg/resources/account_role_acceptance_test.go +++ b/pkg/resources/account_role_acceptance_test.go @@ -217,7 +217,7 @@ func TestAcc_AccountRole_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t CheckDestroy: acc.CheckDestroy(t, resources.AccountRole), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -230,7 +230,7 @@ func TestAcc_AccountRole_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: accountRoleBasicConfig(id.Name(), comment), Check: resource.ComposeAggregateTestCheckFunc( @@ -254,7 +254,7 @@ func TestAcc_AccountRole_WithQuotedName(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.AccountRole), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -269,7 +269,7 @@ func TestAcc_AccountRole_WithQuotedName(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: accountRoleBasicConfig(quotedId, comment), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/alert_acceptance_test.go b/pkg/resources/alert_acceptance_test.go index f038a64257..f021233f08 100644 --- a/pkg/resources/alert_acceptance_test.go +++ b/pkg/resources/alert_acceptance_test.go @@ -216,7 +216,7 @@ func TestAcc_Alert_Issue3117(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Alert), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -229,7 +229,7 @@ func TestAcc_Alert_Issue3117(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: alertIssue3117Config(id, acc.TestClient().Ids.WarehouseId(), "test_alert"), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/api_authentication_integration_with_authorization_code_grant_acceptance_test.go b/pkg/resources/api_authentication_integration_with_authorization_code_grant_acceptance_test.go index d8595cb796..d81c86eac6 100644 --- a/pkg/resources/api_authentication_integration_with_authorization_code_grant_acceptance_test.go +++ b/pkg/resources/api_authentication_integration_with_authorization_code_grant_acceptance_test.go @@ -271,7 +271,7 @@ func TestAcc_ApiAuthenticationIntegrationWithAuthorizationCodeGrant_migrateFromV CheckDestroy: acc.CheckDestroy(t, resources.ApiAuthenticationIntegrationWithAuthorizationCodeGrant), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -284,7 +284,7 @@ func TestAcc_ApiAuthenticationIntegrationWithAuthorizationCodeGrant_migrateFromV ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: apiAuthenticationIntegrationWithAuthorizationCodeGrantBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -307,7 +307,7 @@ func TestAcc_ApiAuthenticationIntegrationWithAuthorizationCodeGrant_WithQuotedNa CheckDestroy: acc.CheckDestroy(t, resources.ApiAuthenticationIntegrationWithAuthorizationCodeGrant), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -322,7 +322,7 @@ func TestAcc_ApiAuthenticationIntegrationWithAuthorizationCodeGrant_WithQuotedNa ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: apiAuthenticationIntegrationWithAuthorizationCodeGrantBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/api_authentication_integration_with_client_credentials_acceptance_test.go b/pkg/resources/api_authentication_integration_with_client_credentials_acceptance_test.go index 1501ca5386..d221bacd85 100644 --- a/pkg/resources/api_authentication_integration_with_client_credentials_acceptance_test.go +++ b/pkg/resources/api_authentication_integration_with_client_credentials_acceptance_test.go @@ -264,7 +264,7 @@ func TestAcc_ApiAuthenticationIntegrationWithClientCredentials_migrateFromV0941_ CheckDestroy: acc.CheckDestroy(t, resources.ApiAuthenticationIntegrationWithClientCredentials), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -277,7 +277,7 @@ func TestAcc_ApiAuthenticationIntegrationWithClientCredentials_migrateFromV0941_ ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: apiAuthenticationIntegrationWithClientCredentialsBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -300,7 +300,7 @@ func TestAcc_ApiAuthenticationIntegrationWithClientCredentials_WithQuotedName(t CheckDestroy: acc.CheckDestroy(t, resources.ApiAuthenticationIntegrationWithClientCredentials), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -315,7 +315,7 @@ func TestAcc_ApiAuthenticationIntegrationWithClientCredentials_WithQuotedName(t ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: apiAuthenticationIntegrationWithClientCredentialsBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/api_authentication_integration_with_jwt_bearer_acceptance_test.go b/pkg/resources/api_authentication_integration_with_jwt_bearer_acceptance_test.go index 78a896334f..a653f71970 100644 --- a/pkg/resources/api_authentication_integration_with_jwt_bearer_acceptance_test.go +++ b/pkg/resources/api_authentication_integration_with_jwt_bearer_acceptance_test.go @@ -232,7 +232,7 @@ func TestAcc_ApiAuthenticationIntegrationWithJwtBearer_migrateFromV0941_ensureSm CheckDestroy: acc.CheckDestroy(t, resources.ApiAuthenticationIntegrationWithJwtBearer), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -245,7 +245,7 @@ func TestAcc_ApiAuthenticationIntegrationWithJwtBearer_migrateFromV0941_ensureSm ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: apiAuthenticationIntegrationWithJwtBearerBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -270,7 +270,7 @@ func TestAcc_ApiAuthenticationIntegrationWithJwtBearer_IdentifierQuotingDiffSupp CheckDestroy: acc.CheckDestroy(t, resources.ApiAuthenticationIntegrationWithJwtBearer), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -285,7 +285,7 @@ func TestAcc_ApiAuthenticationIntegrationWithJwtBearer_IdentifierQuotingDiffSupp ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: apiAuthenticationIntegrationWithJwtBearerBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/database_acceptance_test.go b/pkg/resources/database_acceptance_test.go index d6a5a35003..d46f51d7c5 100644 --- a/pkg/resources/database_acceptance_test.go +++ b/pkg/resources/database_acceptance_test.go @@ -980,7 +980,7 @@ func TestAcc_Database_UpgradeWithTheSameFieldsAsInTheOldOne(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Database), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1046,7 +1046,7 @@ func TestAcc_Database_UpgradeWithDataRetentionSet(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Database), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1110,7 +1110,7 @@ func TestAcc_Database_WithReplication(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Database), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1128,7 +1128,7 @@ func TestAcc_Database_WithReplication(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: databaseStateUpgraderWithReplicationNew(id, secondaryAccountIdentifier), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1271,7 +1271,7 @@ func TestAcc_Database_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t *t CheckDestroy: acc.CheckDestroy(t, resources.Database), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1284,7 +1284,7 @@ func TestAcc_Database_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t *t ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: databaseConfigBasic(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -1321,7 +1321,7 @@ func TestAcc_Database_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Database), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1338,7 +1338,7 @@ func TestAcc_Database_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: databaseConfigBasicWithExternalVolumeAndCatalog(quotedId, quotedExternalVolumeId, quotedCatalogId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/database_role_acceptance_test.go b/pkg/resources/database_role_acceptance_test.go index 11b559eefe..45ab1ddeac 100644 --- a/pkg/resources/database_role_acceptance_test.go +++ b/pkg/resources/database_role_acceptance_test.go @@ -161,7 +161,7 @@ func TestAcc_DatabaseRole_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId( }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -174,7 +174,7 @@ func TestAcc_DatabaseRole_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId( ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, databaseRoleModelWithComment), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -206,7 +206,7 @@ func TestAcc_DatabaseRole_IdentifierQuotingDiffSuppression(t *testing.T) { }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -222,7 +222,7 @@ func TestAcc_DatabaseRole_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, databaseRoleModelWithComment), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/external_function_acceptance_test.go b/pkg/resources/external_function_acceptance_test.go index 61b37e0b58..c53b90167a 100644 --- a/pkg/resources/external_function_acceptance_test.go +++ b/pkg/resources/external_function_acceptance_test.go @@ -239,7 +239,7 @@ func TestAcc_ExternalFunction_migrateFromVersion085(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -292,7 +292,7 @@ func TestAcc_ExternalFunction_migrateFromVersion085_issue2694_previousValuePrese Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -337,7 +337,7 @@ func TestAcc_ExternalFunction_migrateFromVersion085_issue2694_previousValueRemov Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -418,7 +418,7 @@ func TestAcc_ExternalFunction_HeaderParsing(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.ExternalFunction), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.93.0", @@ -440,7 +440,7 @@ func TestAcc_ExternalFunction_HeaderParsing(t *testing.T) { ExpectNonEmptyPlan: true, }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalFunctionConfigIssueCurlyHeader(id), Check: resource.ComposeTestCheckFunc( @@ -588,7 +588,7 @@ func TestAcc_ExternalFunction_EnsureSmoothResourceIdMigrationToV0950(t *testing. CheckDestroy: acc.CheckDestroy(t, resources.ExternalFunction), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -601,7 +601,7 @@ func TestAcc_ExternalFunction_EnsureSmoothResourceIdMigrationToV0950(t *testing. ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalFunctionConfigWithMoreArguments(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( @@ -662,7 +662,7 @@ func TestAcc_ExternalFunction_EnsureSmoothResourceIdMigrationToV0950_WithoutArgu CheckDestroy: acc.CheckDestroy(t, resources.ExternalFunction), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -675,7 +675,7 @@ func TestAcc_ExternalFunction_EnsureSmoothResourceIdMigrationToV0950_WithoutArgu ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalFunctionConfigWithoutArguments(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/external_oauth_integration_acceptance_test.go b/pkg/resources/external_oauth_integration_acceptance_test.go index b29b9de971..4b4f90c415 100644 --- a/pkg/resources/external_oauth_integration_acceptance_test.go +++ b/pkg/resources/external_oauth_integration_acceptance_test.go @@ -773,7 +773,7 @@ func TestAcc_ExternalOauthIntegration_migrateFromVersion092_withRsaPublicKeysAnd Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -800,7 +800,7 @@ func TestAcc_ExternalOauthIntegration_migrateFromVersion092_withRsaPublicKeysAnd ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalOauthIntegrationWithRsaPublicKeysAndBlockedRolesListv093(id.Name(), issuer, rsaKey, role.Name), Check: resource.ComposeAggregateTestCheckFunc( @@ -891,7 +891,7 @@ func TestAcc_ExternalOauthIntegration_migrateFromVersion092_withJwsKeysUrlAndAll Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -918,7 +918,7 @@ func TestAcc_ExternalOauthIntegration_migrateFromVersion092_withJwsKeysUrlAndAll ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalOauthIntegrationWithJwsKeysUrlAndAllowedRolesListv093(id.Name(), issuer, role.Name), Check: resource.ComposeAggregateTestCheckFunc( @@ -992,7 +992,7 @@ func TestAcc_ExternalOauthIntegration_migrateFromV0941_ensureSmoothUpgradeWithNe CheckDestroy: acc.CheckDestroy(t, resources.ExternalOauthSecurityIntegration), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1005,7 +1005,7 @@ func TestAcc_ExternalOauthIntegration_migrateFromV0941_ensureSmoothUpgradeWithNe ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalOauthIntegrationBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -1028,7 +1028,7 @@ func TestAcc_ExternalOauthIntegration_WithQuotedName(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.ExternalOauthSecurityIntegration), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1043,7 +1043,7 @@ func TestAcc_ExternalOauthIntegration_WithQuotedName(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: externalOauthIntegrationBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/function_acceptance_test.go b/pkg/resources/function_acceptance_test.go index 7000d713c1..52d60e3717 100644 --- a/pkg/resources/function_acceptance_test.go +++ b/pkg/resources/function_acceptance_test.go @@ -203,7 +203,7 @@ func TestAcc_Function_migrateFromVersion085(t *testing.T) { // Added as subtask SNOW-1057066 to SNOW-926148. Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -351,7 +351,7 @@ func TestAcc_Function_EnsureSmoothResourceIdMigrationToV0950(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Function), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -364,7 +364,7 @@ func TestAcc_Function_EnsureSmoothResourceIdMigrationToV0950(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: functionConfigWithMoreArguments(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( @@ -413,7 +413,7 @@ func TestAcc_Function_EnsureSmoothResourceIdMigrationToV0950_WithoutArguments(t CheckDestroy: acc.CheckDestroy(t, resources.Function), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -426,7 +426,7 @@ func TestAcc_Function_EnsureSmoothResourceIdMigrationToV0950_WithoutArguments(t ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: functionConfigWithoutArguments(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/grant_account_role_acceptance_test.go b/pkg/resources/grant_account_role_acceptance_test.go index 5591a26889..d9c8c786a3 100644 --- a/pkg/resources/grant_account_role_acceptance_test.go +++ b/pkg/resources/grant_account_role_acceptance_test.go @@ -103,7 +103,7 @@ func TestAcc_GrantAccountRole_migrateFromV0941_ensureSmoothUpgradeWithNewResourc }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -116,7 +116,7 @@ func TestAcc_GrantAccountRole_migrateFromV0941_ensureSmoothUpgradeWithNewResourc ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantAccountRoleBasicConfig(roleName.Name(), parentRoleName.Name()), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -166,7 +166,7 @@ func TestAcc_GrantAccountRole_IdentifierQuotingDiffSuppression(t *testing.T) { }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -177,7 +177,7 @@ func TestAcc_GrantAccountRole_IdentifierQuotingDiffSuppression(t *testing.T) { Config: grantAccountRoleBasicConfig(quotedRoleId, quotedParentRoleId), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantAccountRoleBasicConfig(quotedRoleId, quotedParentRoleId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/grant_application_role_acceptance_test.go b/pkg/resources/grant_application_role_acceptance_test.go index fa9281f397..6068063592 100644 --- a/pkg/resources/grant_application_role_acceptance_test.go +++ b/pkg/resources/grant_application_role_acceptance_test.go @@ -140,7 +140,7 @@ func TestAcc_GrantApplicationRole_migrateFromV0941_ensureSmoothUpgradeWithNewRes }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -153,7 +153,7 @@ func TestAcc_GrantApplicationRole_migrateFromV0941_ensureSmoothUpgradeWithNewRes ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantApplicationRoleBasicConfig(fmt.Sprintf(`\"%s\".\"%s\"`, appRoleId.DatabaseName(), appRoleId.Name()), parentRoleId.Name()), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -202,7 +202,7 @@ func TestAcc_GrantApplicationRole_IdentifierQuotingDiffSuppression(t *testing.T) }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -213,7 +213,7 @@ func TestAcc_GrantApplicationRole_IdentifierQuotingDiffSuppression(t *testing.T) Config: grantApplicationRoleBasicConfig(unquotedApplicationRoleId, quotedParentRoleId), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantApplicationRoleBasicConfig(unquotedApplicationRoleId, quotedParentRoleId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/grant_database_role_acceptance_test.go b/pkg/resources/grant_database_role_acceptance_test.go index 2edefbe0ab..ae43cc32fc 100644 --- a/pkg/resources/grant_database_role_acceptance_test.go +++ b/pkg/resources/grant_database_role_acceptance_test.go @@ -265,7 +265,7 @@ func TestAcc_GrantDatabaseRole_migrateFromV0941_ensureSmoothUpgradeWithNewResour }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -278,7 +278,7 @@ func TestAcc_GrantDatabaseRole_migrateFromV0941_ensureSmoothUpgradeWithNewResour ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantDatabaseRoleBasicConfigQuoted(databaseId.Name(), roleId.Name(), parentRoleId.Name()), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -355,7 +355,7 @@ func TestAcc_GrantDatabaseRole_IdentifierQuotingDiffSuppression(t *testing.T) { }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -370,7 +370,7 @@ func TestAcc_GrantDatabaseRole_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantDatabaseRoleBasicConfigUnquoted(databaseId.Name(), roleId.Name(), parentRoleId.Name()), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/grant_ownership_acceptance_test.go b/pkg/resources/grant_ownership_acceptance_test.go index 17c0988979..e59975eb48 100644 --- a/pkg/resources/grant_ownership_acceptance_test.go +++ b/pkg/resources/grant_ownership_acceptance_test.go @@ -1360,7 +1360,7 @@ func TestAcc_GrantOwnership_migrateFromV0941_ensureSmoothUpgradeWithNewResourceI }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1373,7 +1373,7 @@ func TestAcc_GrantOwnership_migrateFromV0941_ensureSmoothUpgradeWithNewResourceI ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantOwnershipOnTableBasicConfig(acc.TestDatabaseName, acc.TestSchemaName, tableId.Name(), accountRoleId.Name(), escapedFullyQualifiedName), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1436,7 +1436,7 @@ func TestAcc_GrantOwnership_IdentifierQuotingDiffSuppression(t *testing.T) { }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1450,7 +1450,7 @@ func TestAcc_GrantOwnership_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantOwnershipOnTableBasicConfigWithManagedDatabaseAndSchema(databaseId.Name(), schemaId.Name(), tableId.Name(), accountRoleId.Name(), unescapedFullyQualifiedName), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/grant_privileges_to_account_role_acceptance_test.go b/pkg/resources/grant_privileges_to_account_role_acceptance_test.go index 0d359a4cfb..c9a0a44ce2 100644 --- a/pkg/resources/grant_privileges_to_account_role_acceptance_test.go +++ b/pkg/resources/grant_privileges_to_account_role_acceptance_test.go @@ -1750,7 +1750,7 @@ func TestAcc_GrantPrivilegesToAccountRole_migrateFromV0941_ensureSmoothUpgradeWi }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1763,7 +1763,7 @@ func TestAcc_GrantPrivilegesToAccountRole_migrateFromV0941_ensureSmoothUpgradeWi ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToAccountRoleBasicConfig(accountRoleId.Name(), accountRoleId.Name(), quotedSchemaId), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1814,7 +1814,7 @@ func TestAcc_GrantPrivilegesToAccountRole_IdentifierQuotingDiffSuppression(t *te }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1829,7 +1829,7 @@ func TestAcc_GrantPrivilegesToAccountRole_IdentifierQuotingDiffSuppression(t *te ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToAccountRoleBasicConfig(accountRoleId.Name(), unquotedAccountRoleId, unquotedSchemaId), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1917,7 +1917,7 @@ func TestAcc_GrantPrivilegesToAccountRole_OnFutureModels_issue3050(t *testing.T) CheckDestroy: acc.CheckAccountRolePrivilegesRevoked(t), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.95.0", @@ -1928,7 +1928,7 @@ func TestAcc_GrantPrivilegesToAccountRole_OnFutureModels_issue3050(t *testing.T) ExpectNonEmptyPlan: true, }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToAccountRoleOnFutureInDatabaseConfig(accountRoleName, []string{"USAGE"}, sdk.PluralObjectTypeModels, databaseName), }, diff --git a/pkg/resources/grant_privileges_to_database_role_acceptance_test.go b/pkg/resources/grant_privileges_to_database_role_acceptance_test.go index a2a64e7248..c1da413547 100644 --- a/pkg/resources/grant_privileges_to_database_role_acceptance_test.go +++ b/pkg/resources/grant_privileges_to_database_role_acceptance_test.go @@ -1388,7 +1388,7 @@ func TestAcc_GrantPrivilegesToDatabaseRole_migrateFromV0941_ensureSmoothUpgradeW }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1401,7 +1401,7 @@ func TestAcc_GrantPrivilegesToDatabaseRole_migrateFromV0941_ensureSmoothUpgradeW ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToDatabaseRoleBasicConfig(acc.TestClient().Ids.DatabaseId().Name(), databaseRoleId.Name(), quotedDatabaseRoleId, quotedSchemaId), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1453,7 +1453,7 @@ func TestAcc_GrantPrivilegesToDatabaseRole_IdentifierQuotingDiffSuppression(t *t }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1468,7 +1468,7 @@ func TestAcc_GrantPrivilegesToDatabaseRole_IdentifierQuotingDiffSuppression(t *t ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToDatabaseRoleBasicConfig(acc.TestClient().Ids.DatabaseId().Name(), databaseRoleId.Name(), unquotedDatabaseRoleId, unquotedSchemaId), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1502,7 +1502,7 @@ func TestAcc_GrantPrivilegesToDatabaseRole_OnFutureModels_issue3050(t *testing.T CheckDestroy: acc.CheckAccountRolePrivilegesRevoked(t), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.95.0", @@ -1513,7 +1513,7 @@ func TestAcc_GrantPrivilegesToDatabaseRole_OnFutureModels_issue3050(t *testing.T ExpectNonEmptyPlan: true, }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToDatabaseRoleOnFutureInDatabaseConfig(databaseRoleId, []string{"USAGE"}, sdk.PluralObjectTypeModels, databaseName), }, diff --git a/pkg/resources/grant_privileges_to_share_acceptance_test.go b/pkg/resources/grant_privileges_to_share_acceptance_test.go index 8ce187746f..45c7bcd0c0 100644 --- a/pkg/resources/grant_privileges_to_share_acceptance_test.go +++ b/pkg/resources/grant_privileges_to_share_acceptance_test.go @@ -721,7 +721,7 @@ func TestAcc_GrantPrivilegesToShare_migrateFromV0941_ensureSmoothUpgradeWithNewR }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -734,7 +734,7 @@ func TestAcc_GrantPrivilegesToShare_migrateFromV0941_ensureSmoothUpgradeWithNewR ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToShareBasicConfig(databaseId.Name(), shareId.Name()), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -785,7 +785,7 @@ func TestAcc_GrantPrivilegesToShare_IdentifierQuotingDiffSuppression(t *testing. }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -796,7 +796,7 @@ func TestAcc_GrantPrivilegesToShare_IdentifierQuotingDiffSuppression(t *testing. Config: grantPrivilegesToShareBasicConfig(quotedDatabaseId, quotedShareId), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: grantPrivilegesToShareBasicConfig(quotedDatabaseId, quotedShareId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/masking_policy_acceptance_test.go b/pkg/resources/masking_policy_acceptance_test.go index a11f21a0b6..ac8e055173 100644 --- a/pkg/resources/masking_policy_acceptance_test.go +++ b/pkg/resources/masking_policy_acceptance_test.go @@ -413,7 +413,7 @@ func TestAcc_MaskingPolicy_migrateFromVersion_0_94_1(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -427,7 +427,7 @@ func TestAcc_MaskingPolicy_migrateFromVersion_0_94_1(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigDirectory: acc.ConfigurationDirectory("TestAcc_MaskingPolicy/basic"), ConfigVariables: tfconfig.ConfigVariablesFromModel(t, policyModel), @@ -572,7 +572,7 @@ func TestAcc_MaskingPolicy_migrateFromVersion_0_95_0(t *testing.T) { PreCheck: func() { acc.TestAccPreCheck(t) }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.95.0", @@ -597,7 +597,7 @@ func TestAcc_MaskingPolicy_migrateFromVersion_0_95_0(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigDirectory: acc.ConfigurationDirectory("TestAcc_MaskingPolicy/complete"), ConfigVariables: tfconfig.ConfigVariablesFromModel(t, policyModel), diff --git a/pkg/resources/network_policy_acceptance_test.go b/pkg/resources/network_policy_acceptance_test.go index 35c514f306..b205528ee0 100644 --- a/pkg/resources/network_policy_acceptance_test.go +++ b/pkg/resources/network_policy_acceptance_test.go @@ -479,7 +479,7 @@ func TestAcc_NetworkPolicy_Issue2236(t *testing.T) { // Identifier quoting mismatch (no diff suppression) ExpectNonEmptyPlan: true, PreConfig: func() { - acc.SetV097CompatibleConfigPathEnvFunc(t)() + func() { acc.SetV097CompatibleConfigPathEnv(t) }() acc.TestClient().NetworkRule.CreateWithIdentifier(t, allowedNetworkRuleId) acc.TestClient().NetworkRule.CreateWithIdentifier(t, allowedNetworkRuleId2) acc.TestClient().NetworkRule.CreateWithIdentifier(t, blockedNetworkRuleId) @@ -503,7 +503,7 @@ func TestAcc_NetworkPolicy_Issue2236(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: networkPolicyConfigWithNetworkRules( id.Name(), @@ -556,7 +556,7 @@ func TestAcc_NetworkPolicy_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId CheckDestroy: acc.CheckDestroy(t, resources.NetworkPolicy), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -569,7 +569,7 @@ func TestAcc_NetworkPolicy_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: networkPolicyConfigBasic(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -592,7 +592,7 @@ func TestAcc_NetworkPolicy_WithQuotedName(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.NetworkPolicy), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -607,7 +607,7 @@ func TestAcc_NetworkPolicy_WithQuotedName(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: networkPolicyConfigBasic(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/network_rule_acceptance_test.go b/pkg/resources/network_rule_acceptance_test.go index 745242acf7..c6b6bea422 100644 --- a/pkg/resources/network_rule_acceptance_test.go +++ b/pkg/resources/network_rule_acceptance_test.go @@ -134,7 +134,7 @@ func TestAcc_NetworkRule_migrateFromVersion_0_94_1(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -148,7 +148,7 @@ func TestAcc_NetworkRule_migrateFromVersion_0_94_1(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: networkRuleIpv4(id.Name(), acc.TestDatabaseName, acc.TestSchemaName), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/notification_integration_acceptance_test.go b/pkg/resources/notification_integration_acceptance_test.go index d85479dfdb..ffdb782367 100644 --- a/pkg/resources/notification_integration_acceptance_test.go +++ b/pkg/resources/notification_integration_acceptance_test.go @@ -232,7 +232,7 @@ func TestAcc_NotificationIntegration_migrateFromVersion085(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.NotificationIntegration), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -247,7 +247,7 @@ func TestAcc_NotificationIntegration_migrateFromVersion085(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: googleAutoConfigWithoutDirection(accName, gcpPubsubSubscriptionName), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -278,7 +278,7 @@ func TestAcc_NotificationIntegration_migrateFromVersion085_explicitType(t *testi CheckDestroy: acc.CheckDestroy(t, resources.NotificationIntegration), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -291,7 +291,7 @@ func TestAcc_NotificationIntegration_migrateFromVersion085_explicitType(t *testi ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: googleAutoConfig(accName, gcpPubsubSubscriptionName), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/oauth_integration_for_custom_clients_acceptance_test.go b/pkg/resources/oauth_integration_for_custom_clients_acceptance_test.go index 2ccd93a1c5..be88ceab7c 100644 --- a/pkg/resources/oauth_integration_for_custom_clients_acceptance_test.go +++ b/pkg/resources/oauth_integration_for_custom_clients_acceptance_test.go @@ -682,7 +682,7 @@ func TestAcc_OauthIntegrationForCustomClients_migrateFromV0941_ensureSmoothUpgra CheckDestroy: acc.CheckDestroy(t, resourcenames.OauthIntegrationForCustomClients), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -695,7 +695,7 @@ func TestAcc_OauthIntegrationForCustomClients_migrateFromV0941_ensureSmoothUpgra ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: oauthIntegrationForCustomClientsBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -718,7 +718,7 @@ func TestAcc_OauthIntegrationForCustomClients_WithQuotedName(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resourcenames.OauthIntegrationForCustomClients), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -733,7 +733,7 @@ func TestAcc_OauthIntegrationForCustomClients_WithQuotedName(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: oauthIntegrationForCustomClientsBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/oauth_integration_for_partner_applications_acceptance_test.go b/pkg/resources/oauth_integration_for_partner_applications_acceptance_test.go index 10156dab1f..0eccde347c 100644 --- a/pkg/resources/oauth_integration_for_partner_applications_acceptance_test.go +++ b/pkg/resources/oauth_integration_for_partner_applications_acceptance_test.go @@ -687,7 +687,7 @@ func TestAcc_OauthIntegrationForPartnerApplications_migrateFromV0941_ensureSmoot CheckDestroy: acc.CheckDestroy(t, resources.OauthIntegrationForPartnerApplications), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -700,7 +700,7 @@ func TestAcc_OauthIntegrationForPartnerApplications_migrateFromV0941_ensureSmoot ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: oauthIntegrationForPartnerApplicationsBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -723,7 +723,7 @@ func TestAcc_OauthIntegrationForPartnerApplications_WithQuotedName(t *testing.T) CheckDestroy: acc.CheckDestroy(t, resources.OauthIntegrationForPartnerApplications), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -738,7 +738,7 @@ func TestAcc_OauthIntegrationForPartnerApplications_WithQuotedName(t *testing.T) ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: oauthIntegrationForPartnerApplicationsBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/password_policy_acceptance_test.go b/pkg/resources/password_policy_acceptance_test.go index 8a9dceca28..cf978abc3d 100644 --- a/pkg/resources/password_policy_acceptance_test.go +++ b/pkg/resources/password_policy_acceptance_test.go @@ -197,7 +197,7 @@ func TestAcc_PasswordPolicy_migrateFromVersion_0_94_1(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -211,7 +211,7 @@ func TestAcc_PasswordPolicy_migrateFromVersion_0_94_1(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: passwordPolicyBasicConfig(id), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/procedure_acceptance_test.go b/pkg/resources/procedure_acceptance_test.go index ec6aa102d7..05cbfbfd73 100644 --- a/pkg/resources/procedure_acceptance_test.go +++ b/pkg/resources/procedure_acceptance_test.go @@ -212,7 +212,7 @@ func TestAcc_Procedure_migrateFromVersion085(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -277,7 +277,7 @@ func TestAcc_Procedure_proveArgsPermanentDiff(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Procedure), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.89.0", @@ -294,7 +294,7 @@ func TestAcc_Procedure_proveArgsPermanentDiff(t *testing.T) { }, }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: sqlProcedureConfigArgsPermanentDiff(acc.TestDatabaseName, acc.TestSchemaName, name), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -322,7 +322,7 @@ func TestAcc_Procedure_returnTypePermanentDiff(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Procedure), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.89.0", @@ -339,7 +339,7 @@ func TestAcc_Procedure_returnTypePermanentDiff(t *testing.T) { }, }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: sqlProcedureConfigReturnTypePermanentDiff(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( @@ -413,7 +413,7 @@ func TestAcc_Procedure_EnsureSmoothResourceIdMigrationToV0950(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Procedure), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -426,7 +426,7 @@ func TestAcc_Procedure_EnsureSmoothResourceIdMigrationToV0950(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: procedureConfigWithMoreArguments(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( @@ -479,7 +479,7 @@ func TestAcc_Procedure_EnsureSmoothResourceIdMigrationToV0950_WithoutArguments(t CheckDestroy: acc.CheckDestroy(t, resources.Function), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -492,7 +492,7 @@ func TestAcc_Procedure_EnsureSmoothResourceIdMigrationToV0950_WithoutArguments(t ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: procedureConfigWithoutArguments(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( @@ -532,7 +532,7 @@ func TestAcc_Procedure_EnsureSmoothResourceIdMigrationToV0950_ArgumentSynonyms(t CheckDestroy: acc.CheckDestroy(t, resources.Procedure), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -545,7 +545,7 @@ func TestAcc_Procedure_EnsureSmoothResourceIdMigrationToV0950_ArgumentSynonyms(t ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: procedureConfigWithArgumentSynonyms(acc.TestDatabaseName, acc.TestSchemaName, name), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/resource_monitor_acceptance_test.go b/pkg/resources/resource_monitor_acceptance_test.go index 1fd27c76a2..00b99b9227 100644 --- a/pkg/resources/resource_monitor_acceptance_test.go +++ b/pkg/resources/resource_monitor_acceptance_test.go @@ -529,7 +529,7 @@ func TestAcc_ResourceMonitor_Issue1990_RemovingResourceMonitorOutsideOfTerraform Steps: []resource.TestStep{ // Create resource monitor { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.69.0", @@ -565,7 +565,7 @@ func TestAcc_ResourceMonitor_Issue1990_RemovingResourceMonitorOutsideOfTerraform }, // Same configuration, but it's the latest version of the provider (0.96.0 and above) { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, configModel), }, @@ -601,7 +601,7 @@ func TestAcc_ResourceMonitor_Issue_TimestampInfinitePlan(t *testing.T) { Steps: []resource.TestStep{ // Create resource monitor without the timestamps { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.90.0", @@ -644,7 +644,7 @@ func TestAcc_ResourceMonitor_Issue_TimestampInfinitePlan(t *testing.T) { }, // Create resource monitor without the timestamps { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, configModel), }, @@ -682,7 +682,7 @@ func TestAcc_ResourceMonitor_Issue1500_CreatingWithOnlyTriggers(t *testing.T) { Steps: []resource.TestStep{ // Create resource monitor with only triggers (old version) { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.90.0", @@ -694,7 +694,7 @@ func TestAcc_ResourceMonitor_Issue1500_CreatingWithOnlyTriggers(t *testing.T) { }, // Create resource monitor with only triggers (the latest version) { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, configModel), ExpectError: regexp.MustCompile("due to Snowflake limiltations you cannot create Resource Monitor with only triggers set"), @@ -736,7 +736,7 @@ func TestAcc_ResourceMonitor_Issue1500_AlteringWithOnlyTriggers(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.ResourceMonitor), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.90.0", @@ -770,7 +770,7 @@ func TestAcc_ResourceMonitor_Issue1500_AlteringWithOnlyTriggers(t *testing.T) { }, // Upgrade to the latest version { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, configModelWithCreditQuota), }, @@ -906,7 +906,7 @@ func TestAcc_ResourceMonitor_SetForWarehouse(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.ResourceMonitor), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.90.0", @@ -926,7 +926,7 @@ resource "snowflake_resource_monitor" "test" { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: fmt.Sprintf(` resource "snowflake_resource_monitor" "test" { diff --git a/pkg/resources/row_access_policy_acceptance_test.go b/pkg/resources/row_access_policy_acceptance_test.go index baa268e701..e553d16a73 100644 --- a/pkg/resources/row_access_policy_acceptance_test.go +++ b/pkg/resources/row_access_policy_acceptance_test.go @@ -208,7 +208,7 @@ func TestAcc_RowAccessPolicy_Issue2053(t *testing.T) { PreCheck: func() { acc.TestAccPreCheck(t) }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.95.0", @@ -229,7 +229,7 @@ func TestAcc_RowAccessPolicy_Issue2053(t *testing.T) { ExpectNonEmptyPlan: true, }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigDirectory: acc.ConfigurationDirectory("TestAcc_RowAccessPolicy/basic"), ConfigVariables: tfconfig.ConfigVariablesFromModel(t, policyModel), @@ -427,7 +427,7 @@ func TestAcc_RowAccessPolicy_migrateFromVersion_0_95_0_LowercaseArgName(t *testi PreCheck: func() { acc.TestAccPreCheck(t) }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.95.0", @@ -453,7 +453,7 @@ func TestAcc_RowAccessPolicy_migrateFromVersion_0_95_0_LowercaseArgName(t *testi ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigDirectory: acc.ConfigurationDirectory("TestAcc_RowAccessPolicy/basic"), ConfigVariables: tfconfig.ConfigVariablesFromModel(t, policyModel), @@ -509,7 +509,7 @@ func TestAcc_RowAccessPolicy_migrateFromVersion_0_95_0_UppercaseArgName(t *testi PreCheck: func() { acc.TestAccPreCheck(t) }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.95.0", @@ -535,7 +535,7 @@ func TestAcc_RowAccessPolicy_migrateFromVersion_0_95_0_UppercaseArgName(t *testi ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigDirectory: acc.ConfigurationDirectory("TestAcc_RowAccessPolicy/basic"), ConfigVariables: tfconfig.ConfigVariablesFromModel(t, policyModel), diff --git a/pkg/resources/saml2_integration_acceptance_test.go b/pkg/resources/saml2_integration_acceptance_test.go index 7895c135b3..4493a6a248 100644 --- a/pkg/resources/saml2_integration_acceptance_test.go +++ b/pkg/resources/saml2_integration_acceptance_test.go @@ -1082,7 +1082,7 @@ func TestAcc_Saml2Integration_migrateFromV0941_ensureSmoothUpgradeWithNewResourc CheckDestroy: acc.CheckDestroy(t, resources.Saml2SecurityIntegration), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1095,7 +1095,7 @@ func TestAcc_Saml2Integration_migrateFromV0941_ensureSmoothUpgradeWithNewResourc ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: saml2IntegrationBasicConfig(id.Name(), cert), Check: resource.ComposeAggregateTestCheckFunc( @@ -1119,7 +1119,7 @@ func TestAcc_Saml2Integration_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Saml2SecurityIntegration), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1134,7 +1134,7 @@ func TestAcc_Saml2Integration_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: saml2IntegrationBasicConfig(quotedId, cert), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/schema_acceptance_test.go b/pkg/resources/schema_acceptance_test.go index 0ce874fd60..179df30392 100644 --- a/pkg/resources/schema_acceptance_test.go +++ b/pkg/resources/schema_acceptance_test.go @@ -465,7 +465,7 @@ func TestAcc_Schema_ManagePublicVersion_0_94_0(t *testing.T) { Steps: []resource.TestStep{ // PUBLIC can not be created in v0.93 { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.93.0", @@ -544,7 +544,7 @@ func TestAcc_Schema_ManagePublicVersion_0_94_1(t *testing.T) { Steps: []resource.TestStep{ // PUBLIC can not be created in v0.93 { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.93.0", @@ -555,7 +555,7 @@ func TestAcc_Schema_ManagePublicVersion_0_94_1(t *testing.T) { ExpectError: regexp.MustCompile("Error: error creating schema PUBLIC"), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: schemav094WithPipeExecutionPaused(name, db.ID().Name(), true), Check: resource.ComposeTestCheckFunc( @@ -961,7 +961,7 @@ func TestAcc_Schema_migrateFromVersion093WithoutManagedAccess(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.93.0", @@ -975,7 +975,7 @@ func TestAcc_Schema_migrateFromVersion093WithoutManagedAccess(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: schemav094(id.Name(), databaseId.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -1005,7 +1005,7 @@ func TestAcc_Schema_migrateFromVersion093(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.93.0", @@ -1023,7 +1023,7 @@ func TestAcc_Schema_migrateFromVersion093(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: schemav094WithManagedAccessAndDataRetentionTimeInDays(id.Name(), databaseId.Name(), true, 10), Check: resource.ComposeAggregateTestCheckFunc( @@ -1111,7 +1111,7 @@ func TestAcc_Schema_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t *tes CheckDestroy: acc.CheckDestroy(t, resources.Schema), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1124,7 +1124,7 @@ func TestAcc_Schema_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t *tes ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: schemaBasicConfig(id.DatabaseName(), id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -1157,7 +1157,7 @@ func TestAcc_Schema_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Schema), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1173,7 +1173,7 @@ func TestAcc_Schema_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: schemaBasicConfig(quotedDatabaseName, quotedName), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/scim_integration_acceptance_test.go b/pkg/resources/scim_integration_acceptance_test.go index 9989d9b99e..aa8f838cdc 100644 --- a/pkg/resources/scim_integration_acceptance_test.go +++ b/pkg/resources/scim_integration_acceptance_test.go @@ -425,7 +425,7 @@ func TestAcc_ScimIntegration_migrateFromVersion092EnabledTrue(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -439,7 +439,7 @@ func TestAcc_ScimIntegration_migrateFromVersion092EnabledTrue(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: scimIntegrationv093(id.Name(), role.Name(), true, sdk.ScimSecurityIntegrationScimClientGeneric), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -475,7 +475,7 @@ func TestAcc_ScimIntegration_migrateFromVersion092EnabledFalse(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -489,7 +489,7 @@ func TestAcc_ScimIntegration_migrateFromVersion092EnabledFalse(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: scimIntegrationv093(id.Name(), role.Name(), false, sdk.ScimSecurityIntegrationScimClientGeneric), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -518,7 +518,7 @@ func TestAcc_ScimIntegration_migrateFromVersion093HandleSyncPassword(t *testing. Steps: []resource.TestStep{ // create resource with v0.92 { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -552,7 +552,7 @@ func TestAcc_ScimIntegration_migrateFromVersion093HandleSyncPassword(t *testing. }, // check with newest version - the value in state was set to boolean default, so there should be no diff { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: scimIntegrationv093(id.Name(), role.Name(), true, sdk.ScimSecurityIntegrationScimClientAzure), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -602,7 +602,7 @@ func TestAcc_ScimIntegration_migrateFromV0941_ensureSmoothUpgradeWithNewResource CheckDestroy: acc.CheckDestroy(t, resources.ScimSecurityIntegration), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -615,7 +615,7 @@ func TestAcc_ScimIntegration_migrateFromV0941_ensureSmoothUpgradeWithNewResource ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: scimIntegrationBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -638,7 +638,7 @@ func TestAcc_ScimIntegration_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.ScimSecurityIntegration), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -653,7 +653,7 @@ func TestAcc_ScimIntegration_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: scimIntegrationBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/secondary_database_acceptance_test.go b/pkg/resources/secondary_database_acceptance_test.go index bec1f6faab..22cb7c5611 100644 --- a/pkg/resources/secondary_database_acceptance_test.go +++ b/pkg/resources/secondary_database_acceptance_test.go @@ -541,7 +541,7 @@ func TestAcc_SecondaryDatabase_migrateFromV0941_ensureSmoothUpgradeWithNewResour CheckDestroy: acc.CheckDestroy(t, resources.SecondaryDatabase), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -554,7 +554,7 @@ func TestAcc_SecondaryDatabase_migrateFromV0941_ensureSmoothUpgradeWithNewResour ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: secondaryDatabaseConfigBasic(id.Name(), externalPrimaryId.FullyQualifiedName()), Check: resource.ComposeAggregateTestCheckFunc( @@ -593,7 +593,7 @@ func TestAcc_SecondaryDatabase_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.SecondaryDatabase), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -608,7 +608,7 @@ func TestAcc_SecondaryDatabase_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: secondaryDatabaseConfigBasic(quotedId, unquotedExternalPrimaryId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/shared_database_acceptance_test.go b/pkg/resources/shared_database_acceptance_test.go index 0315e16bc6..5c05b8dce2 100644 --- a/pkg/resources/shared_database_acceptance_test.go +++ b/pkg/resources/shared_database_acceptance_test.go @@ -306,7 +306,7 @@ func TestAcc_SharedDatabase_migrateFromV0941_ensureSmoothUpgradeWithNewResourceI CheckDestroy: acc.CheckDestroy(t, resources.SharedDatabase), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -319,7 +319,7 @@ func TestAcc_SharedDatabase_migrateFromV0941_ensureSmoothUpgradeWithNewResourceI ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: sharedDatabaseConfigBasic(id.Name(), externalShareId.FullyQualifiedName()), Check: resource.ComposeAggregateTestCheckFunc( @@ -357,7 +357,7 @@ func TestAcc_SharedDatabase_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.SharedDatabase), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -372,7 +372,7 @@ func TestAcc_SharedDatabase_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: sharedDatabaseConfigBasic(quotedId, unquotedExternalShareId), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/streamlit_acceptance_test.go b/pkg/resources/streamlit_acceptance_test.go index c294e8798e..415bd2a22a 100644 --- a/pkg/resources/streamlit_acceptance_test.go +++ b/pkg/resources/streamlit_acceptance_test.go @@ -449,7 +449,7 @@ func TestAcc_Streamlit_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t * CheckDestroy: acc.CheckDestroy(t, resources.Streamlit), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -462,7 +462,7 @@ func TestAcc_Streamlit_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t * ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: streamlitBasicConfig(id, stage.ID(), "main_file"), Check: resource.ComposeAggregateTestCheckFunc( @@ -503,7 +503,7 @@ func TestAcc_Streamlit_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Streamlit), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -520,7 +520,7 @@ func TestAcc_Streamlit_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: streamlitBasicConfigWithRawIdentifierValues(quotedDatabaseName, quotedSchemaName, quotedName, stage.ID().Name(), "main_file"), ConfigPlanChecks: resource.ConfigPlanChecks{ diff --git a/pkg/resources/table_acceptance_test.go b/pkg/resources/table_acceptance_test.go index b327a0638e..caeeb1daaf 100644 --- a/pkg/resources/table_acceptance_test.go +++ b/pkg/resources/table_acceptance_test.go @@ -1994,7 +1994,7 @@ func TestAcc_Table_migrateFromVersion_0_94_1(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -2008,7 +2008,7 @@ func TestAcc_Table_migrateFromVersion_0_94_1(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: tableConfig(id.Name(), id.DatabaseName(), id.SchemaName()), Check: resource.ComposeTestCheckFunc( @@ -2034,7 +2034,7 @@ func TestAcc_Table_SuppressQuotingOnDefaultSequence_issue2644(t *testing.T) { }, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -2045,7 +2045,7 @@ func TestAcc_Table_SuppressQuotingOnDefaultSequence_issue2644(t *testing.T) { Config: tableConfigWithSequence(name, databaseName, schemaName), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: tableConfigWithSequence(name, databaseName, schemaName), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/table_constraint_acceptance_test.go b/pkg/resources/table_constraint_acceptance_test.go index c6dba1f2d3..89c83573a5 100644 --- a/pkg/resources/table_constraint_acceptance_test.go +++ b/pkg/resources/table_constraint_acceptance_test.go @@ -232,7 +232,7 @@ func TestAcc_Table_issue2535_newConstraint(t *testing.T) { CheckDestroy: nil, Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.86.0", @@ -255,7 +255,7 @@ func TestAcc_Table_issue2535_newConstraint(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: tableConstraintUniqueConfigUsingTableId(accName, acc.TestDatabaseName, acc.TestSchemaName, "|"), ExpectError: regexp.MustCompile(`.*Expected SchemaObjectIdentifier identifier type, but got:.*`), @@ -284,7 +284,7 @@ func TestAcc_Table_issue2535_existingTable(t *testing.T) { Steps: []resource.TestStep{ // reference done by table.id in 0.85.0 { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.85.0", @@ -309,7 +309,7 @@ func TestAcc_Table_issue2535_existingTable(t *testing.T) { }, // fixed in the current version { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: tableConstraintUniqueConfigUsingFullyQualifiedName(accName, acc.TestDatabaseName, acc.TestSchemaName), Check: resource.ComposeTestCheckFunc( diff --git a/pkg/resources/user_acceptance_test.go b/pkg/resources/user_acceptance_test.go index 538ca8d434..137dadcf2d 100644 --- a/pkg/resources/user_acceptance_test.go +++ b/pkg/resources/user_acceptance_test.go @@ -1350,7 +1350,7 @@ func TestAcc_User_migrateFromVersion094_noDefaultSecondaryRolesSet(t *testing.T) CheckDestroy: acc.CheckDestroy(t, resources.User), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1364,7 +1364,7 @@ func TestAcc_User_migrateFromVersion094_noDefaultSecondaryRolesSet(t *testing.T) ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, userModel), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1397,7 +1397,7 @@ func TestAcc_User_migrateFromVersion094_defaultSecondaryRolesSet(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.User), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1416,7 +1416,7 @@ resource "snowflake_user" "test" { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, userModelWithOptionAll), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1673,7 +1673,7 @@ func TestAcc_User_handleChangesToShowUsers_bcr202408_migration_bcr202407_enabled { PreConfig: func() { acc.TestClient().BcrBundles.EnableBcrBundle(t, "2024_07") - acc.SetV097CompatibleConfigPathEnvFunc(t)() + func() { acc.SetV097CompatibleConfigPathEnv(t) }() }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { @@ -1690,7 +1690,7 @@ func TestAcc_User_handleChangesToShowUsers_bcr202408_migration_bcr202407_enabled { PreConfig: func() { acc.TestClient().BcrBundles.EnableBcrBundle(t, "2024_08") - acc.UnsetConfigPathEnvFunc(t)() + func() { acc.UnsetConfigPathEnv(t) }() }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, userModel), @@ -1730,7 +1730,7 @@ func TestAcc_User_handleChangesToShowUsers_bcr202408_migration_bcr202407_disable Source: "Snowflake-Labs/snowflake", }, }, - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, Config: config.FromModel(t, userModel), Check: assert.AssertThat(t, resourceassert.UserResource(t, userModel.ResourceReference()). @@ -1740,7 +1740,7 @@ func TestAcc_User_handleChangesToShowUsers_bcr202408_migration_bcr202407_disable { PreConfig: func() { acc.TestClient().BcrBundles.EnableBcrBundle(t, "2024_08") - acc.UnsetConfigPathEnvFunc(t)() + func() { acc.UnsetConfigPathEnv(t) }() }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: config.FromModel(t, userModel), diff --git a/pkg/resources/user_password_policy_attachment_acceptance_test.go b/pkg/resources/user_password_policy_attachment_acceptance_test.go index 8ad11da6fe..ce3b8e4335 100644 --- a/pkg/resources/user_password_policy_attachment_acceptance_test.go +++ b/pkg/resources/user_password_policy_attachment_acceptance_test.go @@ -82,7 +82,7 @@ func TestAcc_UserPasswordPolicyAttachment_gh3005(t *testing.T) { Steps: []resource.TestStep{ // CREATE { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, Config: userPasswordPolicyAttachmentConfigV087(userName, acc.TestDatabaseName, acc.TestSchemaName, passwordPolicyName), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("snowflake_user_password_policy_attachment.ppa", "user_name", userName), diff --git a/pkg/resources/view_acceptance_test.go b/pkg/resources/view_acceptance_test.go index 65713fd647..2db7a4d7a1 100644 --- a/pkg/resources/view_acceptance_test.go +++ b/pkg/resources/view_acceptance_test.go @@ -1253,7 +1253,7 @@ func TestAcc_view_migrateFromVersion_0_94_1(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1270,7 +1270,7 @@ func TestAcc_view_migrateFromVersion_0_94_1(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigDirectory: acc.ConfigurationDirectory("TestAcc_View/basic"), ConfigVariables: viewConfig, diff --git a/pkg/resources/warehouse_acceptance_test.go b/pkg/resources/warehouse_acceptance_test.go index 09a09f7be0..49f3d678ce 100644 --- a/pkg/resources/warehouse_acceptance_test.go +++ b/pkg/resources/warehouse_acceptance_test.go @@ -1452,7 +1452,7 @@ func TestAcc_Warehouse_migrateFromVersion092_withWarehouseSize(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1466,7 +1466,7 @@ func TestAcc_Warehouse_migrateFromVersion092_withWarehouseSize(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigPlanChecks: resource.ConfigPlanChecks{ PreApply: []plancheck.PlanCheck{ @@ -1495,7 +1495,7 @@ func TestAcc_Warehouse_migrateFromVersion092_allFieldsFilledBeforeMigration(t *t Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1510,7 +1510,7 @@ func TestAcc_Warehouse_migrateFromVersion092_allFieldsFilledBeforeMigration(t *t ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseFullMigrationConfig(id.Name(), false), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1557,7 +1557,7 @@ func TestAcc_Warehouse_migrateFromVersion092_allFieldsFilledBeforeMigration_bool Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1574,7 +1574,7 @@ func TestAcc_Warehouse_migrateFromVersion092_allFieldsFilledBeforeMigration_bool }, // let's try to change the value of the parameter that was earlier a bool and now is a string { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, ConfigPlanChecks: resource.ConfigPlanChecks{ PreApply: []plancheck.PlanCheck{ @@ -1606,7 +1606,7 @@ func TestAcc_Warehouse_migrateFromVersion092_queryAccelerationMaxScaleFactor_sam Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1620,7 +1620,7 @@ func TestAcc_Warehouse_migrateFromVersion092_queryAccelerationMaxScaleFactor_sam ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseFullDefaultConfig(id.Name(), ""), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1654,7 +1654,7 @@ func TestAcc_Warehouse_migrateFromVersion092_queryAccelerationMaxScaleFactor_noI Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1668,7 +1668,7 @@ func TestAcc_Warehouse_migrateFromVersion092_queryAccelerationMaxScaleFactor_noI ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseFullDefaultConfigWithQueryAccelerationMaxScaleFactorRemoved(id.Name(), ""), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1702,7 +1702,7 @@ func TestAcc_Warehouse_migrateFromVersion092_queryAccelerationMaxScaleFactor_dif Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1716,7 +1716,7 @@ func TestAcc_Warehouse_migrateFromVersion092_queryAccelerationMaxScaleFactor_dif ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseFullDefaultConfigWithQueryAcceleration(id.Name(), "", true, 10), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1749,7 +1749,7 @@ func TestAcc_Warehouse_migrateFromVersion092_noConfigToFullConfig(t *testing.T) Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1763,7 +1763,7 @@ func TestAcc_Warehouse_migrateFromVersion092_noConfigToFullConfig(t *testing.T) ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseFullDefaultConfigWithQueryAcceleration(id.Name(), "", true, 8), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1806,7 +1806,7 @@ func TestAcc_Warehouse_migrateFromVersion092_defaultsRemoved(t *testing.T) { Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1836,7 +1836,7 @@ func TestAcc_Warehouse_migrateFromVersion092_defaultsRemoved(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseWithSizeConfig(id.Name(), string(sdk.WarehouseSizeXSmall)), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1876,7 +1876,7 @@ func TestAcc_Warehouse_migrateFromVersion092_warehouseSizeCausingForceNew(t *tes Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.92.0", @@ -1889,7 +1889,7 @@ func TestAcc_Warehouse_migrateFromVersion092_warehouseSizeCausingForceNew(t *tes ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseBasicConfig(id.Name()), ConfigPlanChecks: resource.ConfigPlanChecks{ @@ -1916,7 +1916,7 @@ func TestAcc_Warehouse_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t * CheckDestroy: acc.CheckDestroy(t, resources.Warehouse), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1929,7 +1929,7 @@ func TestAcc_Warehouse_migrateFromV0941_ensureSmoothUpgradeWithNewResourceId(t * ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseBasicConfig(id.Name()), Check: resource.ComposeAggregateTestCheckFunc( @@ -1952,7 +1952,7 @@ func TestAcc_Warehouse_IdentifierQuotingDiffSuppression(t *testing.T) { CheckDestroy: acc.CheckDestroy(t, resources.Warehouse), Steps: []resource.TestStep{ { - PreConfig: acc.SetV097CompatibleConfigPathEnvFunc(t), + PreConfig: func() { acc.SetV097CompatibleConfigPathEnv(t) }, ExternalProviders: map[string]resource.ExternalProvider{ "snowflake": { VersionConstraint: "=0.94.1", @@ -1967,7 +1967,7 @@ func TestAcc_Warehouse_IdentifierQuotingDiffSuppression(t *testing.T) { ), }, { - PreConfig: acc.UnsetConfigPathEnvFunc(t), + PreConfig: func() { acc.UnsetConfigPathEnv(t) }, ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, Config: warehouseBasicConfig(quotedId), ConfigPlanChecks: resource.ConfigPlanChecks{ From 35194ca617966252b6725b18bf2cd528c4667d6c Mon Sep 17 00:00:00 2001 From: Jakub Michalak Date: Mon, 18 Nov 2024 13:10:46 +0100 Subject: [PATCH 08/10] Final fixes --- .github/workflows/tests.yml | 4 ++-- pkg/sdk/testint/security_integrations_gen_integration_test.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cf2ed779df..3ec814e652 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,11 +41,11 @@ jobs: - name: Create and populate .snowflake/config file id: create_config - run: mkdir -p $HOME/.snowflake && echo "${{ secrets.TMP_JMICHALAK_SNOWFLAKE_CONFIG_FILE }}" > $HOME/.snowflake/config + run: mkdir -p $HOME/.snowflake && echo "${{ secrets.SNOWFLAKE_CONFIG_FILE }}" > $HOME/.snowflake/config - name: Create and populate .snowflake/config_v097_compatible file id: create_config_v097_compatible - run: mkdir -p $HOME/.snowflake && echo "${{ secrets.TMP_JMICHALAK_SNOWFLAKE_CONFIG_FILE_V097_COMPATIBLE }}" > $HOME/.snowflake/config_v097_compatible + run: mkdir -p $HOME/.snowflake && echo "${{ secrets.SNOWFLAKE_CONFIG_FILE_V097_COMPATIBLE }}" > $HOME/.snowflake/config_v097_compatible - run: make test if: ${{ !cancelled() && steps.create_config.conclusion == 'success' }} diff --git a/pkg/sdk/testint/security_integrations_gen_integration_test.go b/pkg/sdk/testint/security_integrations_gen_integration_test.go index cc2fd07ab4..69e25666b5 100644 --- a/pkg/sdk/testint/security_integrations_gen_integration_test.go +++ b/pkg/sdk/testint/security_integrations_gen_integration_test.go @@ -889,6 +889,7 @@ func TestInt_SecurityIntegrations(t *testing.T) { externalOauthIssuer: newIssuer, externalOauthAnyRoleMode: string(sdk.ExternalOauthSecurityIntegrationAnyRoleModeDisable), externalOauthRsaPublicKey: rsaKey, + externalOauthScopeMappingAttribute: "scp", externalOauthRsaPublicKey2: rsaKey, externalOauthBlockedRolesList: role1.Name, externalOauthAudienceList: "foo", From 06d6ac3b09f999c2b194efa46d09824507927a57 Mon Sep 17 00:00:00 2001 From: Jakub Michalak Date: Mon, 18 Nov 2024 13:46:37 +0100 Subject: [PATCH 09/10] test --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3ec814e652..cf2ed779df 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,11 +41,11 @@ jobs: - name: Create and populate .snowflake/config file id: create_config - run: mkdir -p $HOME/.snowflake && echo "${{ secrets.SNOWFLAKE_CONFIG_FILE }}" > $HOME/.snowflake/config + run: mkdir -p $HOME/.snowflake && echo "${{ secrets.TMP_JMICHALAK_SNOWFLAKE_CONFIG_FILE }}" > $HOME/.snowflake/config - name: Create and populate .snowflake/config_v097_compatible file id: create_config_v097_compatible - run: mkdir -p $HOME/.snowflake && echo "${{ secrets.SNOWFLAKE_CONFIG_FILE_V097_COMPATIBLE }}" > $HOME/.snowflake/config_v097_compatible + run: mkdir -p $HOME/.snowflake && echo "${{ secrets.TMP_JMICHALAK_SNOWFLAKE_CONFIG_FILE_V097_COMPATIBLE }}" > $HOME/.snowflake/config_v097_compatible - run: make test if: ${{ !cancelled() && steps.create_config.conclusion == 'success' }} From 4736dc6958fe86ca7f85ffa58df1242e32585efe Mon Sep 17 00:00:00 2001 From: Jakub Michalak Date: Mon, 18 Nov 2024 13:58:42 +0100 Subject: [PATCH 10/10] test --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cf2ed779df..3ec814e652 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,11 +41,11 @@ jobs: - name: Create and populate .snowflake/config file id: create_config - run: mkdir -p $HOME/.snowflake && echo "${{ secrets.TMP_JMICHALAK_SNOWFLAKE_CONFIG_FILE }}" > $HOME/.snowflake/config + run: mkdir -p $HOME/.snowflake && echo "${{ secrets.SNOWFLAKE_CONFIG_FILE }}" > $HOME/.snowflake/config - name: Create and populate .snowflake/config_v097_compatible file id: create_config_v097_compatible - run: mkdir -p $HOME/.snowflake && echo "${{ secrets.TMP_JMICHALAK_SNOWFLAKE_CONFIG_FILE_V097_COMPATIBLE }}" > $HOME/.snowflake/config_v097_compatible + run: mkdir -p $HOME/.snowflake && echo "${{ secrets.SNOWFLAKE_CONFIG_FILE_V097_COMPATIBLE }}" > $HOME/.snowflake/config_v097_compatible - run: make test if: ${{ !cancelled() && steps.create_config.conclusion == 'success' }}