fix: try fix errors
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 4s
CI Workflow / CI run tests (pull_request) Failing after 24m13s
CI Workflow / CI run build and linting (pull_request) Successful in 26m11s
CI Workflow / Code coverage report (pull_request) Successful in 4s
CI Workflow / Test readiness for publishing provider (pull_request) Successful in 35m13s
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 4s
CI Workflow / CI run tests (pull_request) Failing after 24m13s
CI Workflow / CI run build and linting (pull_request) Successful in 26m11s
CI Workflow / Code coverage report (pull_request) Successful in 4s
CI Workflow / Test readiness for publishing provider (pull_request) Successful in 35m13s
This commit is contained in:
parent
d5644ec27f
commit
1451273760
14 changed files with 140 additions and 40 deletions
|
|
@ -15,7 +15,7 @@ import (
|
|||
"github.com/stackitcloud/stackit-sdk-go/core/config"
|
||||
|
||||
"tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview/internal/testutils"
|
||||
sqlserverflexbeta2 "tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview/pkg_gen/sqlserverflexbeta"
|
||||
sqlserverflexbetaResGen "tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview/pkg_gen/sqlserverflexbeta"
|
||||
sqlserverflexbeta "tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview/stackit/internal/services/sqlserverflexbeta/instance"
|
||||
|
||||
// The fwresource import alias is so there is no collision
|
||||
|
|
@ -36,7 +36,7 @@ func init() {
|
|||
F: func(region string) error {
|
||||
ctx := context.Background()
|
||||
apiClientConfigOptions := []config.ConfigurationOption{}
|
||||
apiClient, err := sqlserverflexbeta2.NewAPIClient(apiClientConfigOptions...)
|
||||
apiClient, err := sqlserverflexbetaResGen.NewAPIClient(apiClientConfigOptions...)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
|
@ -228,6 +228,67 @@ func TestAccInstance(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func TestAccInstanceReApply(t *testing.T) {
|
||||
exData := getExample()
|
||||
resource.ParallelTest(t, resource.TestCase{
|
||||
PreCheck: func() {
|
||||
testAccPreCheck(t)
|
||||
t.Logf(" ... working on instance %s", exData.TfName)
|
||||
testInstances = append(testInstances, exData.TfName)
|
||||
},
|
||||
ProtoV6ProviderFactories: testutils.TestAccProtoV6ProviderFactories,
|
||||
Steps: []resource.TestStep{
|
||||
// Create and verify
|
||||
{
|
||||
Config: testutils.StringFromTemplateMust(
|
||||
"testdata/instance_template.gompl",
|
||||
exData,
|
||||
),
|
||||
Check: resource.ComposeAggregateTestCheckFunc(
|
||||
resource.TestCheckResourceAttr(resName("instance", exData.TfName), "name", exData.Name),
|
||||
resource.TestCheckResourceAttrSet(resName("instance", exData.TfName), "id"),
|
||||
// TODO: check all fields
|
||||
),
|
||||
},
|
||||
// Create and verify
|
||||
{
|
||||
Config: testutils.StringFromTemplateMust(
|
||||
"testdata/instance_template.gompl",
|
||||
exData,
|
||||
),
|
||||
Check: resource.ComposeAggregateTestCheckFunc(
|
||||
resource.TestCheckResourceAttr(resName("instance", exData.TfName), "name", exData.Name),
|
||||
resource.TestCheckResourceAttrSet(resName("instance", exData.TfName), "id"),
|
||||
// TODO: check all fields
|
||||
),
|
||||
},
|
||||
{
|
||||
RefreshState: true,
|
||||
},
|
||||
// Create and verify
|
||||
{
|
||||
Config: testutils.StringFromTemplateMust(
|
||||
"testdata/instance_template.gompl",
|
||||
exData,
|
||||
),
|
||||
Check: resource.ComposeAggregateTestCheckFunc(
|
||||
resource.TestCheckResourceAttr(resName("instance", exData.TfName), "name", exData.Name),
|
||||
resource.TestCheckResourceAttrSet(resName("instance", exData.TfName), "id"),
|
||||
// TODO: check all fields
|
||||
),
|
||||
},
|
||||
// Import test
|
||||
{
|
||||
ResourceName: resName("instance", exData.TfName),
|
||||
ImportStateKind: resource.ImportBlockWithResourceIdentity,
|
||||
ImportState: true,
|
||||
// ImportStateVerify is not supported with plannable import blocks
|
||||
// ImportStateVerify: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func TestAccInstanceNoEncryption(t *testing.T) {
|
||||
data := getExample()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue