-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Resource monitor v1 readiness (#3052)
## Changes - Add ValuePresent assert to our custom assertions - Add ToConfigValues function for every model - Update Resource Monitor SDK + unit and integration tests - Update Resource Monitor Resource + acc tests - Handle issues connected to the resource monitor (mostly timestamp format difference causing infinite plan or only trigger updates causing SQL compilation error): - #1500 - #1624 - #1716 - #1754 - #1821 - #1832 - #1990 ## Next pr - Adjust examples and update migration notes - Data source (impl, tests, examples, migration notes) ## References * [CREATE RESOURCE MONITOR](https://docs.snowflake.com/en/sql-reference/sql/create-resource-monitor)
- Loading branch information
1 parent
01a7006
commit 42fd40a
Showing
29 changed files
with
2,109 additions
and
861 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
pkg/acceptance/bettertestspoc/assert/objectassert/resource_monitor_snowflake_ext.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package objectassert | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk" | ||
) | ||
|
||
func (r *ResourceMonitorAssert) HasNonEmptyStartTime() *ResourceMonitorAssert { | ||
r.AddAssertion(func(t *testing.T, o *sdk.ResourceMonitor) error { | ||
t.Helper() | ||
if o.StartTime == "" { | ||
return fmt.Errorf("expected start time to be non empty") | ||
} | ||
return nil | ||
}) | ||
return r | ||
} | ||
|
||
func (r *ResourceMonitorAssert) HasNonEmptyEndTime() *ResourceMonitorAssert { | ||
r.AddAssertion(func(t *testing.T, o *sdk.ResourceMonitor) error { | ||
t.Helper() | ||
if o.StartTime == "" { | ||
return fmt.Errorf("expected end time to be non empty") | ||
} | ||
return nil | ||
}) | ||
return r | ||
} |
Oops, something went wrong.