Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jcieslak committed Oct 22, 2024
1 parent 906ab60 commit 6af7ade
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 621 deletions.
3 changes: 2 additions & 1 deletion pkg/acceptance/asserts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package acceptance

import (
"fmt"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
"strconv"

"github.com/hashicorp/terraform-plugin-testing/helper/resource"
)

func IsGreaterOrEqualTo(greaterOrEqualValue int) resource.CheckResourceAttrWithFunc {
Expand Down
6 changes: 3 additions & 3 deletions pkg/acceptance/bettertestspoc/assert/commons.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package assert
import (
"errors"
"fmt"
"golang.org/x/exp/maps"
"strconv"
"strings"
"testing"

"golang.org/x/exp/maps"

"github.com/hashicorp/terraform-plugin-testing/helper/resource"
"github.com/hashicorp/terraform-plugin-testing/terraform"
)
Expand Down Expand Up @@ -105,7 +106,6 @@ func AssertThatObject(t *testing.T, objectAssert InPlaceAssertionVerifier) {
objectAssert.VerifyAll(t)
}

// TODO: This function should iterate over items and look for list item in attributes that matches ALL items' entries AT ONCE (currently it's a pretty dumb assert running through all attributes)
func HasListItemsOrderIndependent(resourceKey string, attributePath string, expectedItems []map[string]string) resource.TestCheckFunc {
return func(state *terraform.State) error {
var actualItems []map[string]string
Expand All @@ -120,7 +120,7 @@ func HasListItemsOrderIndependent(resourceKey string, attributePath string, expe
if attr == "#" {
attrValueLen, err := strconv.Atoi(attrValue)
if err != nil {
return fmt.Errorf("failed to convert length of the attribute %s: %s", attrKey, err)
return fmt.Errorf("failed to convert length of the attribute %s: %w", attrKey, err)
}
if len(expectedItems) != attrValueLen {
return fmt.Errorf("expected to find %d items in %s, but found %d", len(expectedItems), attributePath, attrValueLen)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ var allResourceSchemaDefs = []ResourceSchemaDef{
name: "View",
schema: resources.View().Schema,
},
{
name: "Database",
schema: resources.Database().Schema,
},
{
name: "DatabaseRole",
schema: resources.DatabaseRole().Schema,
Expand All @@ -57,10 +53,6 @@ var allResourceSchemaDefs = []ResourceSchemaDef{
name: "RowAccessPolicy",
schema: resources.RowAccessPolicy().Schema,
},
{
name: "Schema",
schema: resources.Schema().Schema,
},
{
name: "MaskingPolicy",
schema: resources.MaskingPolicy().Schema,
Expand Down
283 changes: 0 additions & 283 deletions pkg/acceptance/bettertestspoc/config/model/database_model_gen.go

This file was deleted.

This file was deleted.

Loading

0 comments on commit 6af7ade

Please sign in to comment.