@@ -14,6 +14,7 @@ import (
1414 "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/helpers"
1515
1616 "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/assert"
17+ "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/assert/customassert"
1718 "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/assert/resourceassert"
1819 "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/assert/resourceshowoutputassert"
1920 "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/config/model"
@@ -120,8 +121,8 @@ func TestAcc_JobService_basic_fromSpecification(t *testing.T) {
120121 assert .Check (resource .TestCheckResourceAttr (modelBasic .ResourceReference (), "describe_output.0.compute_pool" , computePool .ID ().Name ())),
121122 assert .Check (resource .TestCheckResourceAttrSet (modelBasic .ResourceReference (), "describe_output.0.spec" )),
122123 assert .Check (resource .TestCheckResourceAttrSet (modelBasic .ResourceReference (), "describe_output.0.dns_name" )),
123- assert .Check (resource .TestCheckResourceAttr (modelBasic .ResourceReference (), "describe_output.0.current_instances" , "0" )),
124- assert .Check (resource .TestCheckResourceAttr (modelBasic .ResourceReference (), "describe_output.0.target_instances" , "1" )),
124+ assert .Check (resource .TestCheckResourceAttrWith (modelBasic .ResourceReference (), "describe_output.0.current_instances" , customassert . BetweenFunc ( 0 , 1 ) )),
125+ assert .Check (resource .TestCheckResourceAttrWith (modelBasic .ResourceReference (), "describe_output.0.target_instances" , customassert . BetweenFunc ( 0 , 1 ) )),
125126 assert .Check (resource .TestCheckResourceAttr (modelBasic .ResourceReference (), "describe_output.0.min_ready_instances" , "1" )),
126127 assert .Check (resource .TestCheckResourceAttr (modelBasic .ResourceReference (), "describe_output.0.min_instances" , "1" )),
127128 assert .Check (resource .TestCheckResourceAttr (modelBasic .ResourceReference (), "describe_output.0.max_instances" , "1" )),
@@ -197,8 +198,8 @@ func TestAcc_JobService_basic_fromSpecification(t *testing.T) {
197198 assert .CheckImport (importchecks .TestCheckResourceAttrInstanceState (helpers .EncodeResourceIdentifier (id ), "describe_output.0.compute_pool" , computePool .ID ().Name ())),
198199 assert .CheckImport (importchecks .TestCheckResourceAttrInstanceStateSet (helpers .EncodeResourceIdentifier (id ), "describe_output.0.spec" )),
199200 assert .CheckImport (importchecks .TestCheckResourceAttrInstanceStateSet (helpers .EncodeResourceIdentifier (id ), "describe_output.0.dns_name" )),
200- assert .CheckImport (importchecks .TestCheckResourceAttrInstanceState (helpers .EncodeResourceIdentifier (id ), "describe_output.0.current_instances" , "0" )),
201- assert .CheckImport (importchecks .TestCheckResourceAttrInstanceState (helpers .EncodeResourceIdentifier (id ), "describe_output.0.target_instances" , "1" )),
201+ assert .CheckImport (importchecks .TestCheckResourceAttrInstanceStateWith (helpers .EncodeResourceIdentifier (id ), "describe_output.0.current_instances" , customassert . BetweenFunc ( 0 , 1 ) )),
202+ assert .CheckImport (importchecks .TestCheckResourceAttrInstanceStateWith (helpers .EncodeResourceIdentifier (id ), "describe_output.0.target_instances" , customassert . BetweenFunc ( 0 , 1 ) )),
202203 assert .CheckImport (importchecks .TestCheckResourceAttrInstanceState (helpers .EncodeResourceIdentifier (id ), "describe_output.0.min_ready_instances" , "1" )),
203204 assert .CheckImport (importchecks .TestCheckResourceAttrInstanceState (helpers .EncodeResourceIdentifier (id ), "describe_output.0.min_instances" , "1" )),
204205 assert .CheckImport (importchecks .TestCheckResourceAttrInstanceState (helpers .EncodeResourceIdentifier (id ), "describe_output.0.max_instances" , "1" )),
@@ -275,8 +276,8 @@ func TestAcc_JobService_basic_fromSpecification(t *testing.T) {
275276 assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.compute_pool" , computePool .ID ().Name ())),
276277 assert .Check (resource .TestCheckResourceAttrSet (modelComplete .ResourceReference (), "describe_output.0.spec" )),
277278 assert .Check (resource .TestCheckResourceAttrSet (modelComplete .ResourceReference (), "describe_output.0.dns_name" )),
278- assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.current_instances" , "0" )),
279- assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.target_instances" , "1" )),
279+ assert .Check (resource .TestCheckResourceAttrWith (modelComplete .ResourceReference (), "describe_output.0.current_instances" , customassert . BetweenFunc ( 0 , 1 ) )),
280+ assert .Check (resource .TestCheckResourceAttrWith (modelComplete .ResourceReference (), "describe_output.0.target_instances" , customassert . BetweenFunc ( 0 , 1 ) )),
280281 assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.min_ready_instances" , "1" )),
281282 assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.min_instances" , "1" )),
282283 assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.max_instances" , "1" )),
@@ -362,8 +363,8 @@ func TestAcc_JobService_basic_fromSpecification(t *testing.T) {
362363 assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.compute_pool" , computePool .ID ().Name ())),
363364 assert .Check (resource .TestCheckResourceAttrSet (modelComplete .ResourceReference (), "describe_output.0.spec" )),
364365 assert .Check (resource .TestCheckResourceAttrSet (modelComplete .ResourceReference (), "describe_output.0.dns_name" )),
365- assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.current_instances" , "0" )),
366- assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.target_instances" , "1" )),
366+ assert .Check (resource .TestCheckResourceAttrWith (modelComplete .ResourceReference (), "describe_output.0.current_instances" , customassert . BetweenFunc ( 0 , 1 ) )),
367+ assert .Check (resource .TestCheckResourceAttrWith (modelComplete .ResourceReference (), "describe_output.0.target_instances" , customassert . BetweenFunc ( 0 , 1 ) )),
367368 assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.min_ready_instances" , "1" )),
368369 assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.min_instances" , "1" )),
369370 assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.max_instances" , "1" )),
@@ -447,8 +448,8 @@ func TestAcc_JobService_basic_fromSpecification(t *testing.T) {
447448 assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.compute_pool" , computePool .ID ().Name ())),
448449 assert .Check (resource .TestCheckResourceAttrSet (modelComplete .ResourceReference (), "describe_output.0.spec" )),
449450 assert .Check (resource .TestCheckResourceAttrSet (modelComplete .ResourceReference (), "describe_output.0.dns_name" )),
450- assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.current_instances" , "0" )),
451- assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.target_instances" , "1" )),
451+ assert .Check (resource .TestCheckResourceAttrWith (modelComplete .ResourceReference (), "describe_output.0.current_instances" , customassert . BetweenFunc ( 0 , 1 ) )),
452+ assert .Check (resource .TestCheckResourceAttrWith (modelComplete .ResourceReference (), "describe_output.0.target_instances" , customassert . BetweenFunc ( 0 , 1 ) )),
452453 assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.min_ready_instances" , "1" )),
453454 assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.min_instances" , "1" )),
454455 assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.max_instances" , "1" )),
@@ -527,8 +528,8 @@ func TestAcc_JobService_basic_fromSpecification(t *testing.T) {
527528 assert .Check (resource .TestCheckResourceAttr (modelBasic .ResourceReference (), "describe_output.0.compute_pool" , computePool .ID ().Name ())),
528529 assert .Check (resource .TestCheckResourceAttrSet (modelBasic .ResourceReference (), "describe_output.0.spec" )),
529530 assert .Check (resource .TestCheckResourceAttrSet (modelBasic .ResourceReference (), "describe_output.0.dns_name" )),
530- assert .Check (resource .TestCheckResourceAttr (modelBasic .ResourceReference (), "describe_output.0.current_instances" , "0" )),
531- assert .Check (resource .TestCheckResourceAttr (modelBasic .ResourceReference (), "describe_output.0.target_instances" , "1" )),
531+ assert .Check (resource .TestCheckResourceAttrWith (modelBasic .ResourceReference (), "describe_output.0.current_instances" , customassert . BetweenFunc ( 0 , 1 ) )),
532+ assert .Check (resource .TestCheckResourceAttrWith (modelBasic .ResourceReference (), "describe_output.0.target_instances" , customassert . BetweenFunc ( 0 , 1 ) )),
532533 assert .Check (resource .TestCheckResourceAttr (modelBasic .ResourceReference (), "describe_output.0.min_ready_instances" , "1" )),
533534 assert .Check (resource .TestCheckResourceAttr (modelBasic .ResourceReference (), "describe_output.0.min_instances" , "1" )),
534535 assert .Check (resource .TestCheckResourceAttr (modelBasic .ResourceReference (), "describe_output.0.max_instances" , "1" )),
@@ -690,8 +691,8 @@ func TestAcc_JobService_fromSpecificationOnStage(t *testing.T) {
690691 assert .Check (resource .TestCheckResourceAttr (modelBasic .ResourceReference (), "describe_output.0.compute_pool" , computePool .ID ().Name ())),
691692 assert .Check (resource .TestCheckResourceAttrSet (modelBasic .ResourceReference (), "describe_output.0.spec" )),
692693 assert .Check (resource .TestCheckResourceAttrSet (modelBasic .ResourceReference (), "describe_output.0.dns_name" )),
693- assert .Check (resource .TestCheckResourceAttr (modelBasic .ResourceReference (), "describe_output.0.current_instances" , "0" )),
694- assert .Check (resource .TestCheckResourceAttr (modelBasic .ResourceReference (), "describe_output.0.target_instances" , "1" )),
694+ assert .Check (resource .TestCheckResourceAttrWith (modelBasic .ResourceReference (), "describe_output.0.current_instances" , customassert . BetweenFunc ( 0 , 1 ) )),
695+ assert .Check (resource .TestCheckResourceAttrWith (modelBasic .ResourceReference (), "describe_output.0.target_instances" , customassert . BetweenFunc ( 0 , 1 ) )),
695696 assert .Check (resource .TestCheckResourceAttr (modelBasic .ResourceReference (), "describe_output.0.min_ready_instances" , "1" )),
696697 assert .Check (resource .TestCheckResourceAttr (modelBasic .ResourceReference (), "describe_output.0.min_instances" , "1" )),
697698 assert .Check (resource .TestCheckResourceAttr (modelBasic .ResourceReference (), "describe_output.0.max_instances" , "1" )),
@@ -783,8 +784,8 @@ func TestAcc_JobService_fromSpecificationTemplate(t *testing.T) {
783784 assert .Check (resource .TestCheckResourceAttr (model .ResourceReference (), "describe_output.0.compute_pool" , computePool .ID ().Name ())),
784785 assert .Check (resource .TestCheckResourceAttrSet (model .ResourceReference (), "describe_output.0.spec" )),
785786 assert .Check (resource .TestCheckResourceAttrSet (model .ResourceReference (), "describe_output.0.dns_name" )),
786- assert .Check (resource .TestCheckResourceAttr (model .ResourceReference (), "describe_output.0.current_instances" , "0" )),
787- assert .Check (resource .TestCheckResourceAttr (model .ResourceReference (), "describe_output.0.target_instances" , "1" )),
787+ assert .Check (resource .TestCheckResourceAttrWith (model .ResourceReference (), "describe_output.0.current_instances" , customassert . BetweenFunc ( 0 , 1 ) )),
788+ assert .Check (resource .TestCheckResourceAttrWith (model .ResourceReference (), "describe_output.0.target_instances" , customassert . BetweenFunc ( 0 , 1 ) )),
788789 assert .Check (resource .TestCheckResourceAttr (model .ResourceReference (), "describe_output.0.min_ready_instances" , "1" )),
789790 assert .Check (resource .TestCheckResourceAttr (model .ResourceReference (), "describe_output.0.min_instances" , "1" )),
790791 assert .Check (resource .TestCheckResourceAttr (model .ResourceReference (), "describe_output.0.max_instances" , "1" )),
@@ -882,8 +883,8 @@ func TestAcc_JobService_fromSpecificationTemplateOnStage(t *testing.T) {
882883 assert .Check (resource .TestCheckResourceAttr (model .ResourceReference (), "describe_output.0.compute_pool" , computePool .ID ().Name ())),
883884 assert .Check (resource .TestCheckResourceAttrSet (model .ResourceReference (), "describe_output.0.spec" )),
884885 assert .Check (resource .TestCheckResourceAttrSet (model .ResourceReference (), "describe_output.0.dns_name" )),
885- assert .Check (resource .TestCheckResourceAttr (model .ResourceReference (), "describe_output.0.current_instances" , "0" )),
886- assert .Check (resource .TestCheckResourceAttr (model .ResourceReference (), "describe_output.0.target_instances" , "1" )),
886+ assert .Check (resource .TestCheckResourceAttrWith (model .ResourceReference (), "describe_output.0.current_instances" , customassert . BetweenFunc ( 0 , 1 ) )),
887+ assert .Check (resource .TestCheckResourceAttrWith (model .ResourceReference (), "describe_output.0.target_instances" , customassert . BetweenFunc ( 0 , 1 ) )),
887888 assert .Check (resource .TestCheckResourceAttr (model .ResourceReference (), "describe_output.0.min_ready_instances" , "1" )),
888889 assert .Check (resource .TestCheckResourceAttr (model .ResourceReference (), "describe_output.0.min_instances" , "1" )),
889890 assert .Check (resource .TestCheckResourceAttr (model .ResourceReference (), "describe_output.0.max_instances" , "1" )),
@@ -1071,8 +1072,8 @@ func TestAcc_JobService_complete(t *testing.T) {
10711072 assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.compute_pool" , computePool .ID ().Name ())),
10721073 assert .Check (resource .TestCheckResourceAttrSet (modelComplete .ResourceReference (), "describe_output.0.spec" )),
10731074 assert .Check (resource .TestCheckResourceAttrSet (modelComplete .ResourceReference (), "describe_output.0.dns_name" )),
1074- assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.current_instances" , "0" )),
1075- assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.target_instances" , "1" )),
1075+ assert .Check (resource .TestCheckResourceAttrWith (modelComplete .ResourceReference (), "describe_output.0.current_instances" , customassert . BetweenFunc ( 0 , 1 ) )),
1076+ assert .Check (resource .TestCheckResourceAttrWith (modelComplete .ResourceReference (), "describe_output.0.target_instances" , customassert . BetweenFunc ( 0 , 1 ) )),
10761077 assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.min_ready_instances" , "1" )),
10771078 assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.min_instances" , "1" )),
10781079 assert .Check (resource .TestCheckResourceAttr (modelComplete .ResourceReference (), "describe_output.0.max_instances" , "1" )),
0 commit comments