Skip to content

Commit 4b65711

Browse files
Test organization account
1 parent 6173e53 commit 4b65711

File tree

6 files changed

+59
-9
lines changed

6 files changed

+59
-9
lines changed

pkg/acceptance/bettertestspoc/assert/objectassert/organization_account_snowflake_gen.go

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/schemas/organization_account_gen.go

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/sdk/organization_accounts_def.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ var OrganizationAccountsDef = g.NewInterface(
114114
Number("managed_accounts").
115115
Text("consumption_billing_entity_name").
116116
OptionalText("marketplace_consumer_billing_entity_name").
117-
Text("marketplace_provider_billing_entity_name").
117+
OptionalText("marketplace_provider_billing_entity_name").
118118
OptionalText("old_account_url").
119119
Bool("is_org_admin").
120120
OptionalText("account_old_url_saved_on").
@@ -137,7 +137,7 @@ var OrganizationAccountsDef = g.NewInterface(
137137
Number("ManagedAccounts").
138138
Text("ConsumptionBillingEntityName").
139139
OptionalText("MarketplaceConsumerBillingEntityName").
140-
Text("MarketplaceProviderBillingEntityName").
140+
OptionalText("MarketplaceProviderBillingEntityName").
141141
OptionalText("OldAccountUrl").
142142
Bool("IsOrgAdmin").
143143
OptionalText("AccountOldUrlSavedOn").

pkg/sdk/organization_accounts_gen.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/sdk/organization_accounts_impl_gen.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/testacc/resource_current_organization_account_acceptance_test.go

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@ import (
77
"regexp"
88
"testing"
99

10+
tfjson "github.com/hashicorp/terraform-json"
11+
12+
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/assert"
1013
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/assert/resourceassert"
1114
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/assert/resourceshowoutputassert"
1215
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/config"
1316
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/config/model"
1417
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/config/providermodel"
1518
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/helpers/random"
1619
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/planchecks"
20+
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/previewfeatures"
1721
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk"
18-
tfjson "github.com/hashicorp/terraform-json"
1922
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
2023
"github.com/hashicorp/terraform-plugin-testing/plancheck"
2124
"github.com/hashicorp/terraform-plugin-testing/tfversion"
@@ -460,3 +463,44 @@ func TestAcc_CurrentOrganizationAccount_NonEmptyComment_OnCreate(t *testing.T) {
460463
},
461464
})
462465
}
466+
467+
// TODO: Can't be tested as 2.10.0 version doesn't work apparently
468+
func TestAcc_CurrentOrganizationAccount_migrateFromV2_10_0(t *testing.T) {
469+
testClient().EnsureValidNonProdOrganizationAccountIsUsed(t)
470+
471+
currentOrganizationAccountName := testClient().OrganizationAccount.ShowCurrent(t).AccountName
472+
473+
provider := providermodel.SnowflakeProvider().
474+
WithPreviewFeaturesEnabled(string(previewfeatures.CurrentOrganizationAccountResource)).
475+
WithWarehouse(testClient().Ids.WarehouseId().FullyQualifiedName())
476+
477+
configModel := model.CurrentOrganizationAccount("test", currentOrganizationAccountName).
478+
WithComment("SNOWFLAKE")
479+
480+
resource.Test(t, resource.TestCase{
481+
TerraformVersionChecks: []tfversion.TerraformVersionCheck{
482+
tfversion.RequireAbove(tfversion.Version1_5_0),
483+
},
484+
Steps: []resource.TestStep{
485+
//{
486+
// ExternalProviders: ExternalProviderWithExactVersion("2.10.0"),
487+
// Config: config.FromModels(t, provider, configModel),
488+
// Check: assertThat(t,
489+
// assert.Check(resource.TestCheckResourceAttr(configModel.ResourceReference(), "saml_identity_provider", "")),
490+
// ),
491+
//},
492+
{
493+
//ConfigPlanChecks: resource.ConfigPlanChecks{
494+
// PreApply: []plancheck.PlanCheck{
495+
// plancheck.ExpectResourceAction(configModel.ResourceReference(), plancheck.ResourceActionNoop),
496+
// },
497+
//},
498+
ProtoV6ProviderFactories: TestAccProtoV6ProviderFactories,
499+
Config: config.FromModels(t, provider, configModel),
500+
Check: assertThat(t,
501+
assert.Check(resource.TestCheckNoResourceAttr(configModel.ResourceReference(), "saml_identity_provider")),
502+
),
503+
},
504+
},
505+
})
506+
}

0 commit comments

Comments
 (0)