From 77d40780f06ebc8a47fe2d9477be8c30111dda25 Mon Sep 17 00:00:00 2001 From: Artur Sawicki Date: Thu, 19 Dec 2024 12:00:34 +0100 Subject: [PATCH 01/10] fixing tests starts here From cdd87ab5d6dd8638213766cd9b47208281ccf6b9 Mon Sep 17 00:00:00 2001 From: Artur Sawicki Date: Thu, 19 Dec 2024 13:03:10 +0100 Subject: [PATCH 02/10] Fix functions datasource acceptance test --- pkg/datasources/functions_acceptance_test.go | 56 ++++++++++++++----- .../TestAcc_Functions/complete/test.tf | 33 ----------- .../TestAcc_Functions/complete/variables.tf | 15 ----- .../previewfeatures/preview_features.go | 2 + 4 files changed, 44 insertions(+), 62 deletions(-) delete mode 100644 pkg/datasources/testdata/TestAcc_Functions/complete/test.tf delete mode 100644 pkg/datasources/testdata/TestAcc_Functions/complete/variables.tf diff --git a/pkg/datasources/functions_acceptance_test.go b/pkg/datasources/functions_acceptance_test.go index c30ab58db1..06ad075a3b 100644 --- a/pkg/datasources/functions_acceptance_test.go +++ b/pkg/datasources/functions_acceptance_test.go @@ -1,29 +1,26 @@ package datasources_test import ( + "fmt" "testing" acc "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance" - "github.com/hashicorp/terraform-plugin-testing/config" + "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/config" + "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/config/model" + "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/testdatatypes" + "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/testenvs" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/tfversion" ) func TestAcc_Functions(t *testing.T) { - functionNameOne := acc.TestClient().Ids.Alpha() - functionNameTwo := acc.TestClient().Ids.Alpha() + _ = testenvs.GetOrSkipTest(t, testenvs.EnableAcceptance) + acc.TestAccPreCheck(t) + t.Setenv(string(testenvs.ConfigureClientOnce), "") + dataSourceName := "data.snowflake_functions.functions" - m := func() map[string]config.Variable { - return map[string]config.Variable{ - "database": config.StringVariable(acc.TestDatabaseName), - "schema": config.StringVariable(acc.TestSchemaName), - "function_name_one": config.StringVariable(functionNameOne), - "function_name_two": config.StringVariable(functionNameTwo), - } - } - variableSet1 := m() resource.Test(t, resource.TestCase{ ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, PreCheck: func() { acc.TestAccPreCheck(t) }, @@ -33,8 +30,7 @@ func TestAcc_Functions(t *testing.T) { CheckDestroy: nil, Steps: []resource.TestStep{ { - ConfigDirectory: acc.ConfigurationDirectory("TestAcc_Functions/complete"), - ConfigVariables: variableSet1, + Config: functionsConfig(t), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(dataSourceName, "database", acc.TestDatabaseName), resource.TestCheckResourceAttr(dataSourceName, "schema", acc.TestSchemaName), @@ -44,3 +40,35 @@ func TestAcc_Functions(t *testing.T) { }, }) } + +// TODO [SNOW-1348103]: use generated config builder when reworking the datasource +func functionsConfig(t *testing.T) string { + className := "TestFunc" + funcName := "echoVarchar" + argName := "x" + dataType := testdatatypes.DataTypeVarchar_100 + + handler := fmt.Sprintf("%s.%s", className, funcName) + definition := acc.TestClient().Function.SampleJavaDefinition(t, className, funcName, argName) + + id1 := acc.TestClient().Ids.RandomSchemaObjectIdentifierWithArgumentsNewDataTypes(dataType) + id2 := acc.TestClient().Ids.RandomSchemaObjectIdentifierWithArgumentsNewDataTypes(dataType) + + functionsSetup := config.FromModels(t, + model.FunctionJavaBasicInline("f1", id1, dataType, handler, definition).WithArgument(argName, dataType), + model.FunctionJavaBasicInline("f2", id2, dataType, handler, definition).WithArgument(argName, dataType), + ) + + s := fmt.Sprintf(` +%s +data "snowflake_functions" "functions" { + database = "%s" + schema = "%s" + depends_on = [snowflake_function_java.f1, snowflake_function_java.f2] +} +`, functionsSetup, acc.TestDatabaseName, acc.TestSchemaName) + + t.Logf(s) + + return s +} diff --git a/pkg/datasources/testdata/TestAcc_Functions/complete/test.tf b/pkg/datasources/testdata/TestAcc_Functions/complete/test.tf deleted file mode 100644 index 2baba5f105..0000000000 --- a/pkg/datasources/testdata/TestAcc_Functions/complete/test.tf +++ /dev/null @@ -1,33 +0,0 @@ -resource "snowflake_function" "test_function_one" { - name = var.function_name_one - database = var.database - schema = var.schema - return_type = "VARCHAR" - language = "JAVASCRIPT" - statement = <<-EOF - return "Hi" - EOF -} - -resource "snowflake_function" "test_function_two" { - name = var.function_name_two - database = var.database - schema = var.schema - arguments { - name = "arg1" - type = "varchar" - } - comment = "Terraform acceptance test" - return_type = "varchar" - language = "JAVASCRIPT" - statement = <<-EOF - var x = 1 - return x - EOF -} - -data "snowflake_functions" "functions" { - database = var.database - schema = var.schema - depends_on = [snowflake_function.test_function_one, snowflake_function.test_function_two] -} diff --git a/pkg/datasources/testdata/TestAcc_Functions/complete/variables.tf b/pkg/datasources/testdata/TestAcc_Functions/complete/variables.tf deleted file mode 100644 index af64399ad9..0000000000 --- a/pkg/datasources/testdata/TestAcc_Functions/complete/variables.tf +++ /dev/null @@ -1,15 +0,0 @@ -variable "function_name_one" { - type = string -} - -variable "function_name_two" { - type = string -} - -variable "database" { - type = string -} - -variable "schema" { - type = string -} diff --git a/pkg/provider/previewfeatures/preview_features.go b/pkg/provider/previewfeatures/preview_features.go index 112ac705e6..50c5078da6 100644 --- a/pkg/provider/previewfeatures/preview_features.go +++ b/pkg/provider/previewfeatures/preview_features.go @@ -105,6 +105,7 @@ var allPreviewFeatures = []feature{ FunctionPythonResource, FunctionScalaResource, FunctionSqlResource, + FunctionsDatasource, ManagedAccountResource, MaterializedViewResource, MaterializedViewsDatasource, @@ -127,6 +128,7 @@ var allPreviewFeatures = []feature{ ProcedurePythonResource, ProcedureScalaResource, ProcedureSqlResource, + ProceduresDatasource, StageResource, StagesDatasource, StorageIntegrationResource, From d35f121f196d4b8fba89df9c7775913fbf69a619 Mon Sep 17 00:00:00 2001 From: Artur Sawicki Date: Thu, 19 Dec 2024 13:05:47 +0100 Subject: [PATCH 03/10] Add tables datasource to preview features list --- pkg/provider/previewfeatures/preview_features.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/provider/previewfeatures/preview_features.go b/pkg/provider/previewfeatures/preview_features.go index 50c5078da6..5988f260c6 100644 --- a/pkg/provider/previewfeatures/preview_features.go +++ b/pkg/provider/previewfeatures/preview_features.go @@ -140,6 +140,7 @@ var allPreviewFeatures = []feature{ TableColumnMaskingPolicyApplicationResource, TableConstraintResource, TableResource, + TablesDatasource, UserAuthenticationPolicyAttachmentResource, UserPublicKeysResource, UserPasswordPolicyAttachmentResource, From dc4e3dc3f5aab9cd6a4b5178d4e20db7beeabacf Mon Sep 17 00:00:00 2001 From: Artur Sawicki Date: Thu, 19 Dec 2024 13:12:11 +0100 Subject: [PATCH 04/10] Add check destroy to functions datasource test --- pkg/datasources/functions_acceptance_test.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkg/datasources/functions_acceptance_test.go b/pkg/datasources/functions_acceptance_test.go index 06ad075a3b..1bf04c1697 100644 --- a/pkg/datasources/functions_acceptance_test.go +++ b/pkg/datasources/functions_acceptance_test.go @@ -10,6 +10,7 @@ import ( "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/config/model" "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/testdatatypes" "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/testenvs" + "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/resources" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/tfversion" ) @@ -27,7 +28,7 @@ func TestAcc_Functions(t *testing.T) { TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.RequireAbove(tfversion.Version1_5_0), }, - CheckDestroy: nil, + CheckDestroy: acc.CheckDestroy(t, resources.FunctionJava), Steps: []resource.TestStep{ { Config: functionsConfig(t), @@ -59,7 +60,7 @@ func functionsConfig(t *testing.T) string { model.FunctionJavaBasicInline("f2", id2, dataType, handler, definition).WithArgument(argName, dataType), ) - s := fmt.Sprintf(` + return fmt.Sprintf(` %s data "snowflake_functions" "functions" { database = "%s" @@ -67,8 +68,4 @@ data "snowflake_functions" "functions" { depends_on = [snowflake_function_java.f1, snowflake_function_java.f2] } `, functionsSetup, acc.TestDatabaseName, acc.TestSchemaName) - - t.Logf(s) - - return s } From a02e134169a02e7c7fd28be4a7530354a27b0428 Mon Sep 17 00:00:00 2001 From: Artur Sawicki Date: Thu, 19 Dec 2024 13:12:41 +0100 Subject: [PATCH 05/10] Fix procedures datasource test --- pkg/datasources/procedures_acceptance_test.go | 57 ++++++++++++++----- .../TestAcc_Procedures/complete/test.tf | 47 --------------- 2 files changed, 42 insertions(+), 62 deletions(-) delete mode 100644 pkg/datasources/testdata/TestAcc_Procedures/complete/test.tf diff --git a/pkg/datasources/procedures_acceptance_test.go b/pkg/datasources/procedures_acceptance_test.go index ceb1a3cea5..8dc13a0da1 100644 --- a/pkg/datasources/procedures_acceptance_test.go +++ b/pkg/datasources/procedures_acceptance_test.go @@ -1,38 +1,37 @@ package datasources_test import ( + "fmt" + "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/testenvs" "testing" acc "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance" - "github.com/hashicorp/terraform-plugin-testing/config" + + "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/config" + "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/config/model" + "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/testdatatypes" + "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/resources" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/tfversion" ) func TestAcc_Procedures(t *testing.T) { - procNameOne := acc.TestClient().Ids.Alpha() - procNameTwo := acc.TestClient().Ids.Alpha() + _ = testenvs.GetOrSkipTest(t, testenvs.EnableAcceptance) + acc.TestAccPreCheck(t) + t.Setenv(string(testenvs.ConfigureClientOnce), "") + dataSourceName := "data.snowflake_procedures.procedures" - m := func() map[string]config.Variable { - return map[string]config.Variable{ - "database": config.StringVariable(acc.TestDatabaseName), - "schema": config.StringVariable(acc.TestSchemaName), - "proc_name_one": config.StringVariable(procNameOne), - "proc_name_two": config.StringVariable(procNameTwo), - } - } - configVariables := m() + resource.Test(t, resource.TestCase{ ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories, PreCheck: func() { acc.TestAccPreCheck(t) }, TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.RequireAbove(tfversion.Version1_5_0), }, - CheckDestroy: nil, + CheckDestroy: acc.CheckDestroy(t, resources.ProcedureJava), Steps: []resource.TestStep{ { - ConfigDirectory: acc.ConfigurationDirectory("TestAcc_Procedures/complete"), - ConfigVariables: configVariables, + Config: proceduresConfig(t), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(dataSourceName, "database", acc.TestDatabaseName), resource.TestCheckResourceAttr(dataSourceName, "schema", acc.TestSchemaName), @@ -44,3 +43,31 @@ func TestAcc_Procedures(t *testing.T) { }, }) } + +// TODO [SNOW-1348103]: use generated config builder when reworking the datasource +func proceduresConfig(t *testing.T) string { + className := "TestFunc" + funcName := "echoVarchar" + argName := "x" + dataType := testdatatypes.DataTypeVarchar_100 + + handler := fmt.Sprintf("%s.%s", className, funcName) + definition := acc.TestClient().Procedure.SampleJavaDefinition(t, className, funcName, argName) + + id1 := acc.TestClient().Ids.RandomSchemaObjectIdentifierWithArgumentsNewDataTypes(dataType) + id2 := acc.TestClient().Ids.RandomSchemaObjectIdentifierWithArgumentsNewDataTypes(dataType) + + functionsSetup := config.FromModels(t, + model.ProcedureJavaBasicInline("p1", id1, dataType, handler, definition).WithArgument(argName, dataType), + model.ProcedureJavaBasicInline("p2", id2, dataType, handler, definition).WithArgument(argName, dataType), + ) + + return fmt.Sprintf(` +%s +data "snowflake_procedures" "procedures" { + database = "%s" + schema = "%s" + depends_on = [snowflake_procedure_java.p1, snowflake_procedure_java.p2] +} +`, functionsSetup, acc.TestDatabaseName, acc.TestSchemaName) +} diff --git a/pkg/datasources/testdata/TestAcc_Procedures/complete/test.tf b/pkg/datasources/testdata/TestAcc_Procedures/complete/test.tf deleted file mode 100644 index b91ba271a9..0000000000 --- a/pkg/datasources/testdata/TestAcc_Procedures/complete/test.tf +++ /dev/null @@ -1,47 +0,0 @@ -variable "proc_name_one" { - type = string -} - -variable "proc_name_two" { - type = string -} - -variable "database" { - type = string -} - -variable "schema" { - type = string -} - -resource "snowflake_procedure_javascript" "test_proc_one" { - name = var.proc_name_one - database = var.database - schema = var.schema - return_type = "VARCHAR" - statement = <<-EOF - return "Hi" - EOF -} - -resource "snowflake_procedure_javascript" "test_proc_two" { - name = var.proc_name_two - database = var.database - schema = var.schema - arguments { - name = "arg1" - type = "varchar" - } - comment = "Terraform acceptance test" - return_type = "varchar" - statement = <<-EOF - var X=1 - return X - EOF -} - -data "snowflake_procedures" "procedures" { - database = var.database - schema = var.schema - depends_on = [snowflake_procedure_javascript.test_proc_one, snowflake_procedure_javascript.test_proc_two] -} From f1f5668cc90361a82b60bf6a4c2d77afbade01e9 Mon Sep 17 00:00:00 2001 From: Artur Sawicki Date: Thu, 19 Dec 2024 13:20:55 +0100 Subject: [PATCH 06/10] Fix TestAcc_ExternalFunction_complete --- .../TestAcc_ExternalFunction/complete/test.tf | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/pkg/resources/testdata/TestAcc_ExternalFunction/complete/test.tf b/pkg/resources/testdata/TestAcc_ExternalFunction/complete/test.tf index e1e950a78d..718812d8bb 100644 --- a/pkg/resources/testdata/TestAcc_ExternalFunction/complete/test.tf +++ b/pkg/resources/testdata/TestAcc_ExternalFunction/complete/test.tf @@ -6,41 +6,36 @@ resource "snowflake_api_integration" "test_api_int" { enabled = true } -resource "snowflake_function" "test_func_req_translator" { +resource "snowflake_function_javascript" "test_func_req_translator" { name = "${var.name}_request_translator" database = var.database schema = var.schema arguments { - name = "EVENT" - type = "OBJECT" + arg_name = "EVENT" + arg_data_type = "OBJECT" } - comment = "Terraform acceptance test" - return_type = "OBJECT" - language = "javascript" - statement = < Date: Thu, 19 Dec 2024 13:25:58 +0100 Subject: [PATCH 07/10] Fix TestAcc_GrantOwnership_OnObject_ProcedureWithArguments_ToAccountRole --- .../OnObject_Procedure_ToAccountRole/test.tf | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkg/resources/testdata/TestAcc_GrantOwnership/OnObject_Procedure_ToAccountRole/test.tf b/pkg/resources/testdata/TestAcc_GrantOwnership/OnObject_Procedure_ToAccountRole/test.tf index f460e20ad6..8aff8d7098 100644 --- a/pkg/resources/testdata/TestAcc_GrantOwnership/OnObject_Procedure_ToAccountRole/test.tf +++ b/pkg/resources/testdata/TestAcc_GrantOwnership/OnObject_Procedure_ToAccountRole/test.tf @@ -16,14 +16,13 @@ resource "snowflake_procedure_javascript" "test" { database = snowflake_database.test.name schema = snowflake_schema.test.name arguments { - name = "ARG1" - type = "FLOAT" + arg_name = "ARG1" + arg_data_type = "FLOAT" } - return_type = "FLOAT" - execute_as = "CALLER" - return_behavior = "VOLATILE" - null_input_behavior = "RETURNS NULL ON NULL INPUT" - statement = < Date: Thu, 19 Dec 2024 13:27:36 +0100 Subject: [PATCH 08/10] Fix TestAcc_GrantOwnership_OnObject_ProcedureWithoutArguments_ToDatabaseRole --- .../OnObject_Procedure_ToDatabaseRole/test.tf | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pkg/resources/testdata/TestAcc_GrantOwnership/OnObject_Procedure_ToDatabaseRole/test.tf b/pkg/resources/testdata/TestAcc_GrantOwnership/OnObject_Procedure_ToDatabaseRole/test.tf index 0a0e43aa07..abc405c062 100644 --- a/pkg/resources/testdata/TestAcc_GrantOwnership/OnObject_Procedure_ToDatabaseRole/test.tf +++ b/pkg/resources/testdata/TestAcc_GrantOwnership/OnObject_Procedure_ToDatabaseRole/test.tf @@ -13,14 +13,13 @@ resource "snowflake_schema" "test" { } resource "snowflake_procedure_javascript" "test" { - name = var.procedure_name - database = snowflake_database.test.name - schema = snowflake_schema.test.name - return_type = "FLOAT" - execute_as = "CALLER" - return_behavior = "VOLATILE" - null_input_behavior = "RETURNS NULL ON NULL INPUT" - statement = < Date: Thu, 19 Dec 2024 13:43:32 +0100 Subject: [PATCH 09/10] Fix extended authenticator test --- pkg/sdk/config_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/sdk/config_test.go b/pkg/sdk/config_test.go index af8a448061..7be95c1cd6 100644 --- a/pkg/sdk/config_test.go +++ b/pkg/sdk/config_test.go @@ -366,7 +366,6 @@ func Test_ToExtendedAuthenticatorType(t *testing.T) { {input: "OAUTH", want: gosnowflake.AuthTypeOAuth}, {input: "EXTERNALBROWSER", want: gosnowflake.AuthTypeExternalBrowser}, {input: "OKTA", want: gosnowflake.AuthTypeOkta}, - {input: "JWT", want: gosnowflake.AuthTypeJwt}, {input: "SNOWFLAKE_JWT", want: gosnowflake.AuthTypeJwt}, {input: "TOKENACCESSOR", want: gosnowflake.AuthTypeTokenAccessor}, {input: "USERNAMEPASSWORDMFA", want: gosnowflake.AuthTypeUsernamePasswordMFA}, @@ -376,6 +375,7 @@ func Test_ToExtendedAuthenticatorType(t *testing.T) { invalid := []test{ {input: " "}, {input: "foo"}, + {input: "JWT"}, } for _, tc := range valid { From 5600673da10e14769b9f7cb875f3693638411611 Mon Sep 17 00:00:00 2001 From: Artur Sawicki Date: Thu, 19 Dec 2024 15:30:42 +0100 Subject: [PATCH 10/10] Run pre-push --- docs/index.md | 2 +- pkg/datasources/functions_acceptance_test.go | 2 ++ pkg/datasources/procedures_acceptance_test.go | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/index.md b/docs/index.md index 31fc8211d8..bc11401f91 100644 --- a/docs/index.md +++ b/docs/index.md @@ -97,7 +97,7 @@ provider "snowflake" { - `passcode_in_password` (Boolean) False by default. Set to true if the MFA passcode is embedded to the configured password. Can also be sourced from the `SNOWFLAKE_PASSCODE_IN_PASSWORD` environment variable. - `password` (String, Sensitive) Password for user + password auth. Cannot be used with `private_key` and `private_key_passphrase`. Can also be sourced from the `SNOWFLAKE_PASSWORD` environment variable. - `port` (Number) Specifies a custom port value used by the driver for privatelink connections. Can also be sourced from the `SNOWFLAKE_PORT` environment variable. -- `preview_features_enabled` (Set of String) A list of preview features that are handled by the provider. See [preview features list](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/v1-preparations/LIST_OF_PREVIEW_FEATURES_FOR_V1.md). Preview features may have breaking changes in future releases, even without raising the major version. This field can not be set with environmental variables. Valid options are: `snowflake_current_account_datasource` | `snowflake_account_authentication_policy_attachment_resource` | `snowflake_account_password_policy_attachment_resource` | `snowflake_alert_resource` | `snowflake_alerts_datasource` | `snowflake_api_integration_resource` | `snowflake_authentication_policy_resource` | `snowflake_cortex_search_service_resource` | `snowflake_cortex_search_services_datasource` | `snowflake_database_datasource` | `snowflake_database_role_datasource` | `snowflake_dynamic_table_resource` | `snowflake_dynamic_tables_datasource` | `snowflake_external_function_resource` | `snowflake_external_functions_datasource` | `snowflake_external_table_resource` | `snowflake_external_tables_datasource` | `snowflake_external_volume_resource` | `snowflake_failover_group_resource` | `snowflake_failover_groups_datasource` | `snowflake_file_format_resource` | `snowflake_file_formats_datasource` | `snowflake_function_java_resource` | `snowflake_function_javascript_resource` | `snowflake_function_python_resource` | `snowflake_function_scala_resource` | `snowflake_function_sql_resource` | `snowflake_managed_account_resource` | `snowflake_materialized_view_resource` | `snowflake_materialized_views_datasource` | `snowflake_network_policy_attachment_resource` | `snowflake_network_rule_resource` | `snowflake_email_notification_integration_resource` | `snowflake_notification_integration_resource` | `snowflake_object_parameter_resource` | `snowflake_password_policy_resource` | `snowflake_pipe_resource` | `snowflake_pipes_datasource` | `snowflake_current_role_datasource` | `snowflake_sequence_resource` | `snowflake_sequences_datasource` | `snowflake_share_resource` | `snowflake_shares_datasource` | `snowflake_parameters_datasource` | `snowflake_procedure_java_resource` | `snowflake_procedure_javascript_resource` | `snowflake_procedure_python_resource` | `snowflake_procedure_scala_resource` | `snowflake_procedure_sql_resource` | `snowflake_stage_resource` | `snowflake_stages_datasource` | `snowflake_storage_integration_resource` | `snowflake_storage_integrations_datasource` | `snowflake_system_generate_scim_access_token_datasource` | `snowflake_system_get_aws_sns_iam_policy_datasource` | `snowflake_system_get_privatelink_config_datasource` | `snowflake_system_get_snowflake_platform_info_datasource` | `snowflake_table_column_masking_policy_application_resource` | `snowflake_table_constraint_resource` | `snowflake_table_resource` | `snowflake_user_authentication_policy_attachment_resource` | `snowflake_user_public_keys_resource` | `snowflake_user_password_policy_attachment_resource`. +- `preview_features_enabled` (Set of String) A list of preview features that are handled by the provider. See [preview features list](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/v1-preparations/LIST_OF_PREVIEW_FEATURES_FOR_V1.md). Preview features may have breaking changes in future releases, even without raising the major version. This field can not be set with environmental variables. Valid options are: `snowflake_current_account_datasource` | `snowflake_account_authentication_policy_attachment_resource` | `snowflake_account_password_policy_attachment_resource` | `snowflake_alert_resource` | `snowflake_alerts_datasource` | `snowflake_api_integration_resource` | `snowflake_authentication_policy_resource` | `snowflake_cortex_search_service_resource` | `snowflake_cortex_search_services_datasource` | `snowflake_database_datasource` | `snowflake_database_role_datasource` | `snowflake_dynamic_table_resource` | `snowflake_dynamic_tables_datasource` | `snowflake_external_function_resource` | `snowflake_external_functions_datasource` | `snowflake_external_table_resource` | `snowflake_external_tables_datasource` | `snowflake_external_volume_resource` | `snowflake_failover_group_resource` | `snowflake_failover_groups_datasource` | `snowflake_file_format_resource` | `snowflake_file_formats_datasource` | `snowflake_function_java_resource` | `snowflake_function_javascript_resource` | `snowflake_function_python_resource` | `snowflake_function_scala_resource` | `snowflake_function_sql_resource` | `snowflake_functions_datasource` | `snowflake_managed_account_resource` | `snowflake_materialized_view_resource` | `snowflake_materialized_views_datasource` | `snowflake_network_policy_attachment_resource` | `snowflake_network_rule_resource` | `snowflake_email_notification_integration_resource` | `snowflake_notification_integration_resource` | `snowflake_object_parameter_resource` | `snowflake_password_policy_resource` | `snowflake_pipe_resource` | `snowflake_pipes_datasource` | `snowflake_current_role_datasource` | `snowflake_sequence_resource` | `snowflake_sequences_datasource` | `snowflake_share_resource` | `snowflake_shares_datasource` | `snowflake_parameters_datasource` | `snowflake_procedure_java_resource` | `snowflake_procedure_javascript_resource` | `snowflake_procedure_python_resource` | `snowflake_procedure_scala_resource` | `snowflake_procedure_sql_resource` | `snowflake_procedures_datasource` | `snowflake_stage_resource` | `snowflake_stages_datasource` | `snowflake_storage_integration_resource` | `snowflake_storage_integrations_datasource` | `snowflake_system_generate_scim_access_token_datasource` | `snowflake_system_get_aws_sns_iam_policy_datasource` | `snowflake_system_get_privatelink_config_datasource` | `snowflake_system_get_snowflake_platform_info_datasource` | `snowflake_table_column_masking_policy_application_resource` | `snowflake_table_constraint_resource` | `snowflake_table_resource` | `snowflake_tables_datasource` | `snowflake_user_authentication_policy_attachment_resource` | `snowflake_user_public_keys_resource` | `snowflake_user_password_policy_attachment_resource`. - `private_key` (String, Sensitive) Private Key for username+private-key auth. Cannot be used with `password`. Can also be sourced from the `SNOWFLAKE_PRIVATE_KEY` environment variable. - `private_key_passphrase` (String, Sensitive) Supports the encryption ciphers aes-128-cbc, aes-128-gcm, aes-192-cbc, aes-192-gcm, aes-256-cbc, aes-256-gcm, and des-ede3-cbc. Can also be sourced from the `SNOWFLAKE_PRIVATE_KEY_PASSPHRASE` environment variable. - `profile` (String) Sets the profile to read from ~/.snowflake/config file. Can also be sourced from the `SNOWFLAKE_PROFILE` environment variable. diff --git a/pkg/datasources/functions_acceptance_test.go b/pkg/datasources/functions_acceptance_test.go index 1bf04c1697..4ac49882fe 100644 --- a/pkg/datasources/functions_acceptance_test.go +++ b/pkg/datasources/functions_acceptance_test.go @@ -44,6 +44,8 @@ func TestAcc_Functions(t *testing.T) { // TODO [SNOW-1348103]: use generated config builder when reworking the datasource func functionsConfig(t *testing.T) string { + t.Helper() + className := "TestFunc" funcName := "echoVarchar" argName := "x" diff --git a/pkg/datasources/procedures_acceptance_test.go b/pkg/datasources/procedures_acceptance_test.go index 8dc13a0da1..cf055e5850 100644 --- a/pkg/datasources/procedures_acceptance_test.go +++ b/pkg/datasources/procedures_acceptance_test.go @@ -2,9 +2,10 @@ package datasources_test import ( "fmt" - "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/testenvs" "testing" + "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/testenvs" + acc "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance" "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/config" @@ -46,6 +47,8 @@ func TestAcc_Procedures(t *testing.T) { // TODO [SNOW-1348103]: use generated config builder when reworking the datasource func proceduresConfig(t *testing.T) string { + t.Helper() + className := "TestFunc" funcName := "echoVarchar" argName := "x"