Skip to content

Commit

Permalink
update for bpt 1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
apeabody committed Nov 25, 2024
1 parent 0bff530 commit 9e5e334
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 90 deletions.
8 changes: 4 additions & 4 deletions test/integration/node_pool/node_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ import (
"testing"
"time"

"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/cai"
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/gcloud"
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/golden"
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/tft"
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/utils"
"github.com/gruntwork-io/terratest/modules/k8s"
"github.com/stretchr/testify/assert"
"github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/testutils"
gkeutils "github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/utils"
)

func TestNodePool(t *testing.T) {
Expand All @@ -36,15 +36,15 @@ func TestNodePool(t *testing.T) {
bpt.DefineVerify(func(assert *assert.Assertions) {
// Skipping Default Verify as the Verify Stage fails due to change in Client Cert Token
// bpt.DefaultVerify(assert)
gkeutils.TGKEVerify(t, bpt, assert) // Verify Resources
testutils.TGKEVerify(t, bpt, assert) // Verify Resources

projectId := bpt.GetStringOutput("project_id")
location := bpt.GetStringOutput("location")
clusterName := bpt.GetStringOutput("cluster_name")

// CAI
clusterResourceName := fmt.Sprintf("//container.googleapis.com/projects/%s/locations/%s/clusters/%s", projectId, location, clusterName)
cluster := gkeutils.GetProjectResources(t, projectId, gkeutils.WithAssetTypes([]string{"container.googleapis.com/Cluster"})).Get("#(name=\"" + clusterResourceName + "\").resource.data")
cluster := cai.GetProjectResources(t, projectId, cai.WithAssetTypes([]string{"container.googleapis.com/Cluster"})).Get("#(name=\"" + clusterResourceName + "\").resource.data")

// Equivalent gcloud describe command
// cluster := gcloud.Runf(t, "container clusters describe %s --zone %s --project %s", clusterName, location, projectId)
Expand Down Expand Up @@ -186,7 +186,7 @@ func TestNodePool(t *testing.T) {
k8sOpts := k8s.KubectlOptions{}
clusterNodesOp, err := k8s.RunKubectlAndGetOutputE(t, &k8sOpts, "get", "nodes", "-o", "json")
assert.NoError(err)
clusterNodes := testutils.ParseKubectlJSONResult(t, clusterNodesOp)
clusterNodes := utils.ParseKubectlJSONResult(t, clusterNodesOp)
assert.JSONEq(`[
{
"effect": "PreferNoSchedule",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/tft"
"github.com/stretchr/testify/assert"
"github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/testutils"
gkeutils "github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/utils"
)

func TestSaferClusterIapBastion(t *testing.T) {
Expand All @@ -34,7 +33,7 @@ func TestSaferClusterIapBastion(t *testing.T) {
bpt.DefineVerify(func(assert *assert.Assertions) {
// Skipping Default Verify as the Verify Stage fails due to change in Client Cert Token
// bpt.DefaultVerify(assert)
gkeutils.TGKEVerify(t, bpt, assert) // Verify Resources
testutils.TGKEVerify(t, bpt, assert) // Verify Resources

test_command, _ := strings.CutPrefix(bpt.GetStringOutput("test_command"), "gcloud ")

Expand Down
82 changes: 0 additions & 82 deletions test/integration/utils/cai.go

This file was deleted.

3 changes: 1 addition & 2 deletions test/integration/workload_identity/workload_identity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/tft"
"github.com/stretchr/testify/assert"
"github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/testutils"
gkeutils "github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/utils"
)

func TestWorkloadIdentity(t *testing.T) {
Expand All @@ -33,7 +32,7 @@ func TestWorkloadIdentity(t *testing.T) {
bpt.DefineVerify(func(assert *assert.Assertions) {
// Skipping Default Verify as the Verify Stage fails due to change in Client Cert Token
// bpt.DefaultVerify(assert)
gkeutils.TGKEVerify(t, bpt, assert) // Verify Resources
testutils.TGKEVerify(t, bpt, assert) // Verify Resources

projectId := bpt.GetStringOutput("project_id")
location := bpt.GetStringOutput("location")
Expand Down

0 comments on commit 9e5e334

Please sign in to comment.