Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Introduce assertions generators part1 #2952

Merged
merged 63 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
3e158bc
Add PoC of snowflake parameters assertions
sfc-gh-asawicki Jul 19, 2024
751d730
Add all user parameters assertions
sfc-gh-asawicki Jul 19, 2024
79cf4a0
Use assertions in user integration tests
sfc-gh-asawicki Jul 19, 2024
86b6890
Fix the tests
sfc-gh-asawicki Jul 19, 2024
262f776
Add generic checks
sfc-gh-asawicki Jul 19, 2024
077a861
Add generic default checks
sfc-gh-asawicki Jul 19, 2024
47bb554
Add TODOs
sfc-gh-asawicki Jul 19, 2024
74412d2
Add TODOs
sfc-gh-asawicki Jul 19, 2024
ed54823
Add default checks for user parameters
sfc-gh-asawicki Jul 19, 2024
52f99e9
Add level assertions
sfc-gh-asawicki Jul 19, 2024
ff89925
Move gen utils to separate gencommons
sfc-gh-asawicki Jul 19, 2024
b4a8c71
Move struct details extractor to separate gencommons
sfc-gh-asawicki Jul 19, 2024
cbb2026
Extract write to file helper func
sfc-gh-asawicki Jul 19, 2024
50fbd3a
Rename to struct details
sfc-gh-asawicki Jul 19, 2024
b4cf5ef
Extract a common func for template execution for all objects
sfc-gh-asawicki Jul 19, 2024
2b8f725
Move common func to generate and print
sfc-gh-asawicki Jul 19, 2024
93fe57c
Prepare a generator skeleton (WIP)
sfc-gh-asawicki Jul 19, 2024
e2143e3
Rewrite show output generator using the generator skeleton
sfc-gh-asawicki Jul 19, 2024
0d3f120
Fix the gen
sfc-gh-asawicki Jul 19, 2024
f5ae021
Move helper funcs to the generator
sfc-gh-asawicki Jul 19, 2024
97e861d
Add flags to the generator skeleton
sfc-gh-asawicki Jul 19, 2024
f9fd204
Allow passing the arguments to the generator
sfc-gh-asawicki Jul 19, 2024
088b5c4
Extract common template functions
sfc-gh-asawicki Jul 19, 2024
da74f1e
Extract mapper commons
sfc-gh-asawicki Jul 19, 2024
423fd33
Take template helper func by name
sfc-gh-asawicki Jul 19, 2024
a3702a6
Remove already done TODOs
sfc-gh-asawicki Jul 19, 2024
a3e1004
Allow using multiple flags (hacky)
sfc-gh-asawicki Jul 19, 2024
6c10a18
Add possibility to filter objects
sfc-gh-asawicki Jul 19, 2024
43fd094
Add example filter
sfc-gh-asawicki Jul 19, 2024
0bae099
Prepare snowflake object assertions generator (WIP)
sfc-gh-asawicki Jul 21, 2024
f8cb936
Add add assertion func
sfc-gh-asawicki Jul 21, 2024
4e50d80
Add assertion through method
sfc-gh-asawicki Jul 21, 2024
a3a0525
Add additional standard imports (quick and dirty)
sfc-gh-asawicki Jul 21, 2024
67b13cc
Extract list of objects
sfc-gh-asawicki Jul 21, 2024
fc9d1ef
Move generate snowflake object to the destination package
sfc-gh-asawicki Jul 21, 2024
0c7ce27
Reorganize
sfc-gh-asawicki Jul 21, 2024
0968d59
Prepare snowflake object parameters generation
sfc-gh-asawicki Jul 21, 2024
c01ec37
Rename templates
sfc-gh-asawicki Jul 21, 2024
94e58f4
Continue objects parameters assertions generation
sfc-gh-asawicki Jul 21, 2024
1ab5384
Add generic checks generation
sfc-gh-asawicki Jul 21, 2024
c0ad76c
Expose snowflake parameters assertions and helpers
sfc-gh-asawicki Jul 21, 2024
22af4ff
Add aggregated generic checks
sfc-gh-asawicki Jul 21, 2024
66b1831
Add value checks
sfc-gh-asawicki Jul 21, 2024
043e9bf
Add all other specific object parameter checks
sfc-gh-asawicki Jul 21, 2024
d450052
Clean up templates a bit
sfc-gh-asawicki Jul 21, 2024
8e2d238
Add all user parameters
sfc-gh-asawicki Jul 21, 2024
839b2db
Change names
sfc-gh-asawicki Jul 21, 2024
0d768e9
Update comment
sfc-gh-asawicki Jul 22, 2024
351797f
Generate snowflake object assertion for warehouse and user
sfc-gh-asawicki Jul 22, 2024
202d92a
Fix the package and use generated user assertions
sfc-gh-asawicki Jul 22, 2024
341001d
Add a quick workaround for user param
sfc-gh-asawicki Jul 22, 2024
38b77ed
Remove manually created user parameters
sfc-gh-asawicki Jul 22, 2024
f3c55f2
Remove manually created warehouse object assertions
sfc-gh-asawicki Jul 22, 2024
9646487
Update readme
sfc-gh-asawicki Jul 22, 2024
8c81ebb
Add README to the generator commons
sfc-gh-asawicki Jul 22, 2024
7f7d4fa
Run make pre-push
sfc-gh-asawicki Jul 22, 2024
bd561e9
Add explicit field names
sfc-gh-asawicki Jul 22, 2024
edfddf2
Use the generated assertions in warehouse acceptance tests
sfc-gh-asawicki Jul 22, 2024
3015e4b
Update readme and TODOs
sfc-gh-asawicki Jul 22, 2024
b358270
Fix the tests
sfc-gh-asawicki Jul 23, 2024
cef6917
Run acceptance tests regardless of the integration tests result
sfc-gh-asawicki Jul 23, 2024
6e2b034
Fix after review
sfc-gh-asawicki Jul 24, 2024
962dbdd
Merge branch 'main' into assertions-generators-part1
sfc-gh-asawicki Jul 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: mkdir $HOME/.snowflake && echo "${{ secrets.SNOWFLAKE_CONFIG_FILE }}" > $HOME/.snowflake/config

- run: make test
if: steps.create_config.conclusion == 'success'
if: ${{ !cancelled() && steps.create_config.conclusion == 'success' }}
env:
SNOWFLAKE_BUSINESS_CRITICAL_ACCOUNT: ${{ secrets.SNOWFLAKE_BUSINESS_CRITICAL_ACCOUNT }}
TEST_SF_TF_AWS_EXTERNAL_BUCKET_URL: ${{ secrets.TEST_SF_TF_AWS_EXTERNAL_BUCKET_URL }}
Expand All @@ -57,14 +57,15 @@ jobs:
TEST_SF_TF_GCS_EXTERNAL_BUCKET_URL: ${{ secrets.TEST_SF_TF_GCS_EXTERNAL_BUCKET_URL }}

- name: Setup Terraform
if: steps.create_config.conclusion == 'success'
if: ${{ !cancelled() && steps.create_config.conclusion == 'success' }}
uses: hashicorp/setup-terraform@v3
id: setup_terraform
with:
terraform_version: 1.7.4
terraform_wrapper: false

- run: make test-acceptance
if: steps.create_config.conclusion == 'success'
if: ${{ !cancelled() && steps.setup_terraform.conclusion == 'success' }}
env:
SNOWFLAKE_BUSINESS_CRITICAL_ACCOUNT: ${{ secrets.SNOWFLAKE_BUSINESS_CRITICAL_ACCOUNT }}
TEST_SF_TF_AWS_EXTERNAL_BUCKET_URL: ${{ secrets.TEST_SF_TF_AWS_EXTERNAL_BUCKET_URL }}
Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,16 @@ generate-show-output-schemas: ## Generate show output schemas with mappers
clean-show-output-schemas: ## Clean generated show output schemas
rm -f ./pkg/schemas/*_gen.go

generate-snowflake-object-assertions: ## Generate snowflake object assertions
go generate ./pkg/acceptance/bettertestspoc/assert/objectassert/generate.go

clean-snowflake-object-assertions: ## Clean snowflake object assertions
rm -f ./pkg/acceptance/bettertestspoc/assert/objectassert/*_gen.go

generate-snowflake-object-parameters-assertions: ## Generate snowflake object parameters assertions
go generate ./pkg/acceptance/bettertestspoc/assert/objectparametersassert/generate.go

clean-snowflake-object-parameters-assertions: ## Clean snowflake object parameters assertions
rm -f ./pkg/acceptance/bettertestspoc/assert/objectparametersassert/*_gen.go

.PHONY: build-local clean-generator-poc dev-setup dev-cleanup docs docs-check fmt fmt-check fumpt help install lint lint-fix mod mod-check pre-push pre-push-check sweep test test-acceptance uninstall-tf
77 changes: 32 additions & 45 deletions pkg/acceptance/bettertestspoc/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Better tests poc
This package contains a quick implementation of helpers that should allow us a quicker, more pleasant, and more readable implementation of tests, mainly the acceptance ones.
It contains the following packages:
- `assert` - all the assertions reside here. The currently supported assertions are: resource assertions, show output assertions, parameters assertions, and Snowflake object assertions.
The package contains utilities to build assertions for new objects.
All the assertions will be ultimately generated; the ones presented for warehouse were manually created.
- `assert` - all the assertions reside here. Also, the utilities to build assertions for new objects. All the assertions will be ultimately generated; the ones presented in this folder were manually created. The currently supported assertions are:
- resource assertions (currently, created manually)
- show output assertions (currently, created manually)
- resource parameters assertions (currently, created manually)
- Snowflake object assertions (generated in subpackage `objectassert`)
- Snowflake object parameters assertions (generated in subpackage `objectparametersassert`)

- `config` - the new ResourceModel abstraction resides here. It provides models for objects and the builder methods allowing better config preparation in the acceptance tests.
It aims to be more readable than using `Config:` with hardcoded string or `ConfigFile:` for file that is not directly reachable from the test body. Also, it should be easier to reuse the models and prepare convenience extension methods.
All the models will be ultimately generated; the ones presented for warehouse were manually created.
Expand All @@ -21,7 +25,7 @@ You can check the current example usage in `TestAcc_Warehouse_BasicFlows` and th
assert.WarehouseParameters(t, "snowflake_warehouse.w").
HasMaxConcurrencyLevel(16).
HasMaxConcurrencyLevelLevel(sdk.ParameterTypeWarehouse),
assert.Warehouse(t, warehouseId).
objectassert.Warehouse(t, warehouseId).
HasName("bad name").
HasState(sdk.WarehouseStateSuspended).
HasType(sdk.WarehouseTypeSnowparkOptimized).
Expand Down Expand Up @@ -89,7 +93,7 @@ it will result in:
HasStatementQueuedTimeoutInSecondsLevel(sdk.ParameterTypeWarehouse).
HasStatementTimeoutInSeconds(1232).
HasStatementTimeoutInSecondsLevel(sdk.ParameterTypeWarehouse),
assert.Warehouse(t, warehouseId).
objectassert.Warehouse(t, warehouseId).
HasName("bad name").
HasState(sdk.WarehouseStateSuspended).
HasType(sdk.WarehouseTypeSnowparkOptimized).
Expand Down Expand Up @@ -147,7 +151,7 @@ it will result in:
- add the following to the `create: complete` in `TestInt_Warehouses`:
```go
// to show errors
warehouseAssertionsBad := objectAssert.Warehouse(t, id).
warehouseAssertionsBad := objectassert.Warehouse(t, id).
HasName("bad name").
HasState(sdk.WarehouseStateSuspended).
HasType(sdk.WarehouseTypeSnowparkOptimized).
Expand All @@ -161,7 +165,7 @@ it will result in:
HasComment("bad comment").
HasEnableQueryAcceleration(false).
HasQueryAccelerationMaxScaleFactor(12)
objectAssert.AssertThatObject(t, warehouseAssertionsBad)
assertions.AssertThatObject(t, warehouseAssertionsBad)
```
it will result in:
```
Expand Down Expand Up @@ -345,43 +349,9 @@ func (w *WarehouseParametersAssert) HasDefaultStatementTimeoutInSeconds() *Wareh
```

## Adding new Snowflake object assertions
For object `abc` create the following files with the described content in the `assert` package:
- `abc_snowflake.go`
```go
type AbcAssert struct {
*SnowflakeObjectAssert[sdk.Abc, sdk.AccountObjectIdentifier]
}

func Abc(t *testing.T, id sdk.AccountObjectIdentifier) *AbcAssert {
t.Helper()
return &AbcAssert{
NewSnowflakeObjectAssertWithProvider(sdk.ObjectTypeAbc, id, acc.TestClient().Abc.Show),
}
}

func AbcFromObject(t *testing.T, abc *sdk.Abc) *AbcAssert {
t.Helper()
return &AbcAssert{
NewSnowflakeObjectAssertWithObject(sdk.ObjectTypeAbc, abc.ID(), abc),
}
}
```

A method for each object parameter (let's say parameter name is xyz):
```go
func (w *AbcAssert) HasXyz(expected string) *AbcAssert {
w.assertions = append(w.assertions, func(t *testing.T, o *sdk.Abc) error {
t.Helper()
if o.Xyz != expected {
return fmt.Errorf("expected xyz: %v; got: %v", expected, o.Xyz)
}
return nil
})
return w
}
```

- `abc_snowflake_ext.go` - for the easier separation later (when we start generating the common checks for each object). Example would be:
Snowflake object assertions can be generated automatically. For object `abc` do the following:
- add object you want to generate to `allStructs` slice in the `assert/objectassert/gen/main/main.go`
- to add custom (not generated assertions) create file `abc_snowflake_ext.go` in the `objectassert` package. Example would be:
```go
func (w *WarehouseAssert) HasStateOneOf(expected ...sdk.WarehouseState) *WarehouseAssert {
w.assertions = append(w.assertions, func(t *testing.T, o *sdk.Warehouse) error {
Expand All @@ -395,6 +365,19 @@ func (w *WarehouseAssert) HasStateOneOf(expected ...sdk.WarehouseState) *Warehou
}
```

## Adding new Snowflake object parameters assertions
Snowflake object parameters assertions can be generated automatically. For object `abc` do the following:
- add object you want to generate to `allObjectsParameters` slice in the `assert/objectparametersassert/gen/main/main.go`
- make sure that test helper method `acc.TestClient().Parameter.ShowAbcParameters` exists in `/pkg/acceptance/helpers/parameter_client.go`
- to add custom (not generated assertions) create file `abc_parameters_snowflake_ext.go` in the `objectparametersassert` package. Example would be:
```go
func (w *WarehouseParametersAssert) HasDefaultMaxConcurrencyLevel() *WarehouseParametersAssert {
return w.
HasMaxConcurrencyLevel(8).
HasMaxConcurrencyLevelLevel("")
}
```

## Adding new models
For object `abc` create the following files with the described content in the `config` package:
- `abc_model.go`
Expand Down Expand Up @@ -447,7 +430,7 @@ func BasicWarehouseModel(
```

## Known limitations/planned improvements
- Generate all assertions and models.
- Generate all missing assertions and models.
- Test all the utilities for assertion/model construction (public interfaces, methods, functions).
- Verify if all the config types are supported.
- Consider a better implementation for the model conversion to config (TODO left).
Expand All @@ -468,3 +451,7 @@ func (w *WarehouseDatasourceShowOutputAssert) IsEmpty() {
w.assertions = append(w.assertions, valueSet("show_output.#", "0"))
}
```
- support other mappings if needed (TODO left in `assert/objectassert/gen/model.go`)
- consider extracting preamble model to commons (TODOs left in `assert/objectassert/gen/model.go` and in `assert/objectparametersassert/gen/model.go`)
- get a runtime name for the assertion creator (TODOs left in `assert/objectparametersassert/gen/model.go`)
- use a better definition for each objet's snowflake parameters (TODO left in `assert/objectparametersassert/gen/main/main.go`)
55 changes: 55 additions & 0 deletions pkg/acceptance/bettertestspoc/assert/objectassert/gen/main/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//go:build exclude

package main

import (
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/assert/objectassert/gen"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/gencommons"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk"
)

func main() {
gencommons.NewGenerator(
getSdkObjectDetails,
gen.ModelFromSdkObjectDetails,
getFilename,
gen.AllTemplates,
).
RunAndHandleOsReturn()
}

type SdkObjectDef struct {
idType string
objectType sdk.ObjectType
objectStruct any
}

func getSdkObjectDetails() []gencommons.SdkObjectDetails {
allSdkObjectsDetails := make([]gencommons.SdkObjectDetails, len(allStructs))
for idx, d := range allStructs {
structDetails := gencommons.ExtractStructDetails(d.objectStruct)
allSdkObjectsDetails[idx] = gencommons.SdkObjectDetails{
IdType: d.idType,
ObjectType: d.objectType,
StructDetails: structDetails,
}
}
return allSdkObjectsDetails
}

func getFilename(_ gencommons.SdkObjectDetails, model gen.SnowflakeObjectAssertionsModel) string {
return gencommons.ToSnakeCase(model.Name) + "_snowflake" + "_gen.go"
}

var allStructs = []SdkObjectDef{
{
idType: "sdk.AccountObjectIdentifier",
objectType: sdk.ObjectTypeUser,
objectStruct: sdk.User{},
},
{
idType: "sdk.AccountObjectIdentifier",
objectType: sdk.ObjectTypeWarehouse,
objectStruct: sdk.Warehouse{},
},
}
81 changes: 81 additions & 0 deletions pkg/acceptance/bettertestspoc/assert/objectassert/gen/model.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
package gen

import (
"os"
"slices"
"strings"

"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/gencommons"
)

// TODO [SNOW-1501905]: extract to commons?
type PreambleModel struct {
PackageName string
AdditionalStandardImports []string
}

type SnowflakeObjectAssertionsModel struct {
Name string
SdkType string
IdType string
Fields []SnowflakeObjectFieldAssertion
PreambleModel
}

func (m SnowflakeObjectAssertionsModel) SomeFunc() {
}

type SnowflakeObjectFieldAssertion struct {
Name string
ConcreteType string
IsOriginalTypePointer bool
Mapper gencommons.Mapper
}

func ModelFromSdkObjectDetails(sdkObject gencommons.SdkObjectDetails) SnowflakeObjectAssertionsModel {
name, _ := strings.CutPrefix(sdkObject.Name, "sdk.")
fields := make([]SnowflakeObjectFieldAssertion, len(sdkObject.Fields))
imports := make(map[string]struct{})
for idx, field := range sdkObject.Fields {
fields[idx] = MapToSnowflakeObjectFieldAssertion(field)
additionalImport, isImportedType := field.GetImportedType()
if isImportedType {
imports[additionalImport] = struct{}{}
}
}
additionalImports := make([]string, 0)
for k := range imports {
if !slices.Contains([]string{"sdk"}, k) {
additionalImports = append(additionalImports, k)
}
}

packageWithGenerateDirective := os.Getenv("GOPACKAGE")
return SnowflakeObjectAssertionsModel{
Name: name,
SdkType: sdkObject.Name,
IdType: sdkObject.IdType,
Fields: fields,
PreambleModel: PreambleModel{
PackageName: packageWithGenerateDirective,
AdditionalStandardImports: additionalImports,
},
}
}

func MapToSnowflakeObjectFieldAssertion(field gencommons.Field) SnowflakeObjectFieldAssertion {
concreteTypeWithoutPtr, _ := strings.CutPrefix(field.ConcreteType, "*")

// TODO [SNOW-1501905]: handle other mappings if needed
mapper := gencommons.Identity
if concreteTypeWithoutPtr == "sdk.AccountObjectIdentifier" {
mapper = gencommons.Name
}

return SnowflakeObjectFieldAssertion{
Name: field.Name,
ConcreteType: field.ConcreteType,
IsOriginalTypePointer: field.IsPointer(),
Mapper: mapper,
}
}
33 changes: 33 additions & 0 deletions pkg/acceptance/bettertestspoc/assert/objectassert/gen/templates.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package gen

import (
"text/template"

_ "embed"

"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/gencommons"
)

var (
//go:embed templates/preamble.tmpl
preambleTemplateContent string
PreambleTemplate, _ = template.New("preambleTemplate").Parse(preambleTemplateContent)

//go:embed templates/definition.tmpl
definitionTemplateContent string
DefinitionTemplate, _ = template.New("definitionTemplate").Funcs(gencommons.BuildTemplateFuncMap(
gencommons.FirstLetterLowercase,
)).Parse(definitionTemplateContent)

//go:embed templates/assertions.tmpl
assertionsTemplateContent string
AssertionsTemplate, _ = template.New("assertionsTemplate").Funcs(gencommons.BuildTemplateFuncMap(
gencommons.FirstLetterLowercase,
gencommons.FirstLetter,
gencommons.TypeWithoutPointer,
gencommons.CamelToWords,
gencommons.RunMapper,
)).Parse(assertionsTemplateContent)

AllTemplates = []*template.Template{PreambleTemplate, DefinitionTemplate, AssertionsTemplate}
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{- /*gotype: github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/assert/objectassert/gen.SnowflakeObjectAssertionsModel*/ -}}

{{ $assertName := .Name | printf "%sAssert" }}
sfc-gh-jcieslak marked this conversation as resolved.
Show resolved Hide resolved
{{ $sdkType := .SdkType }}
{{ $nameLowerCase := FirstLetterLowercase .Name }}
{{ $assertVar := FirstLetter $nameLowerCase }}
{{- range .Fields }}
func ({{ $assertVar }} *{{ $assertName }}) Has{{ .Name }}(expected {{ TypeWithoutPointer .ConcreteType }}) *{{ $assertName }} {
{{ $assertVar }}.AddAssertion(func(t *testing.T, o *{{ $sdkType }}) error {
t.Helper()
{{ if .IsOriginalTypePointer -}}
if o.{{ .Name }} == nil {
return fmt.Errorf("expected {{ CamelToWords .Name }} to have value; got: nil")
}
{{ end -}}
if {{ if .IsOriginalTypePointer }}*{{ end }}{{ RunMapper .Mapper "o." .Name }} != {{ RunMapper .Mapper "expected" }} {
return fmt.Errorf("expected {{ CamelToWords .Name }}: %v; got: %v", {{ RunMapper .Mapper "expected" }}, {{ if .IsOriginalTypePointer }}*{{ end }}{{ RunMapper .Mapper "o." .Name }})
}
return nil
})
return {{ $assertVar }}
}
{{ end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- /*gotype: github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/assert/objectassert/gen.SnowflakeObjectAssertionsModel*/ -}}

{{ $assertName := .Name | printf "%sAssert" }}
{{ $nameLowerCase := FirstLetterLowercase .Name }}
type {{ $assertName }} struct {
*assert.SnowflakeObjectAssert[{{ .SdkType }}, {{ .IdType }}]
}

func {{ .Name }}(t *testing.T, id {{ .IdType }}) *{{ $assertName }} {
t.Helper()
return &{{ $assertName }}{
assert.NewSnowflakeObjectAssertWithProvider(sdk.ObjectType{{ .Name }}, id, acc.TestClient().{{ .Name }}.Show),
}
}

func {{ .Name }}FromObject(t *testing.T, {{ $nameLowerCase }} *{{ .SdkType }}) *{{ $assertName }} {
t.Helper()
return &{{ $assertName }}{
assert.NewSnowflakeObjectAssertWithObject(sdk.ObjectType{{ .Name }}, {{ $nameLowerCase }}.ID(), {{ $nameLowerCase }}),
}
}
Loading
Loading