@@ -21,6 +21,7 @@ import (
2121 "github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/gcloud"
2222 "github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/golden"
2323 "github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/tft"
24+ "github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/utils"
2425 "github.com/gruntwork-io/terratest/modules/k8s"
2526 "github.com/stretchr/testify/assert"
2627 "github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/testutils"
@@ -92,6 +93,18 @@ func TestNodePool(t *testing.T) {
9293 g .JSONEq (assert , cluster , pth )
9394 }
9495
96+ fmt .Println ("one path" )
97+ g .JSONPathEqs (assert , cluster , []string {"autoscaling.autoprovisioningNodePoolDefaults.imageType" })
98+
99+ fmt .Println ("multi path" )
100+ g .JSONPathEqs (assert , cluster , validateJSONPaths )
101+
102+ fmt .Println ("all paths" )
103+ // Test validating all Paths
104+ evalPaths := utils .GetJSONPaths (cluster )
105+ fmt .Println (evalPaths )
106+ g .JSONPathEqs (assert , cluster , evalPaths )
107+
95108 // Pool-01
96109 assert .Equal ("pool-01" , cluster .Get ("nodePools.#(name==\" pool-01\" ).name" ).String (), "pool-1 exists" )
97110 assert .Equal ("e2-medium" , cluster .Get ("nodePools.#(name==\" pool-01\" ).config.machineType" ).String (), "is the expected machine type" )
0 commit comments