Skip to content

Commit 16cf00d

Browse files
committed
chore: add retry for CI
1 parent 1835f80 commit 16cf00d

File tree

20 files changed

+139
-40
lines changed

20 files changed

+139
-40
lines changed

test/integration/beta_cluster/beta_cluster_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2022-2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -17,16 +17,20 @@ package beta_cluster
1717
import (
1818
"fmt"
1919
"testing"
20+
"time"
2021

2122
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/gcloud"
2223
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/golden"
2324
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/tft"
2425
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/utils"
2526
"github.com/stretchr/testify/assert"
27+
"github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/testutils"
2628
)
2729

2830
func TestBetaCluster(t *testing.T) {
29-
gke := tft.NewTFBlueprintTest(t)
31+
gke := tft.NewTFBlueprintTest(t,
32+
tft.WithRetryableTerraformErrors(testutils.RetryableTransientErrors, 1, 2*time.Minute),
33+
)
3034

3135
gke.DefineVerify(func(assert *assert.Assertions) {
3236
// Commenting Default Verify due to issue 1478 for location Policy

test/integration/deploy_service/deploy_service_test.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2022-2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@ package deploy_service
1515

1616
import (
1717
"fmt"
18-
"io/ioutil"
18+
"io"
1919
"net/http"
2020
"testing"
2121
"time"
@@ -25,10 +25,13 @@ import (
2525
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/utils"
2626
"github.com/gruntwork-io/terratest/modules/k8s"
2727
"github.com/stretchr/testify/assert"
28+
"github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/testutils"
2829
)
2930

3031
func TestDeployService(t *testing.T) {
31-
bpt := tft.NewTFBlueprintTest(t)
32+
bpt := tft.NewTFBlueprintTest(t,
33+
tft.WithRetryableTerraformErrors(testutils.RetryableTransientErrors, 1, 2*time.Minute),
34+
)
3235

3336
bpt.DefineVerify(func(assert *assert.Assertions) {
3437
// bpt.DefaultVerify(assert)
@@ -57,7 +60,7 @@ func TestDeployService(t *testing.T) {
5760
utils.Poll(t, pollHTTPEndPoint(serviceUrl), 20, 10*time.Second)
5861
response, err := http.Get(serviceUrl)
5962
assert.NoError(err)
60-
responseData, err := ioutil.ReadAll(response.Body)
63+
responseData, err := io.ReadAll(response.Body)
6164
assert.NoError(err)
6265
assert.Contains(string(responseData), "Thank you for using nginx.", "Service is Functional")
6366
})

test/integration/disable_client_cert/disable_client_cert_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2022-2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -16,15 +16,19 @@ package disable_client_cert
1616

1717
import (
1818
"testing"
19+
"time"
1920

2021
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/gcloud"
2122
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/golden"
2223
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/tft"
2324
"github.com/stretchr/testify/assert"
25+
"github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/testutils"
2426
)
2527

2628
func TestDisableClientCert(t *testing.T) {
27-
bpt := tft.NewTFBlueprintTest(t)
29+
bpt := tft.NewTFBlueprintTest(t,
30+
tft.WithRetryableTerraformErrors(testutils.RetryableTransientErrors, 1, 2*time.Minute),
31+
)
2832

2933
bpt.DefineVerify(func(assert *assert.Assertions) {
3034
//Skipping Default Verify as the Verify Stage fails due to change in Client Cert Token

test/integration/private_zonal_with_networking/private_zonal_with_networking_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2022-2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -16,16 +16,20 @@ package private_zonal_with_networking
1616

1717
import (
1818
"testing"
19+
"time"
1920

2021
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/gcloud"
2122
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/golden"
2223
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/tft"
2324
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/utils"
2425
"github.com/stretchr/testify/assert"
26+
"github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/testutils"
2527
)
2628

2729
func TestPrivateZonalWithNetworking(t *testing.T) {
28-
bpt := tft.NewTFBlueprintTest(t)
30+
bpt := tft.NewTFBlueprintTest(t,
31+
tft.WithRetryableTerraformErrors(testutils.RetryableTransientErrors, 1, 2*time.Minute),
32+
)
2933

3034
bpt.DefineVerify(func(assert *assert.Assertions) {
3135
// Commenting Default Verify due to issue 1478 for location Policy

test/integration/safer_cluster/safer_cluster_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2022-2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -15,15 +15,19 @@ package safer_cluster
1515

1616
import (
1717
"testing"
18+
"time"
1819

1920
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/gcloud"
2021
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/golden"
2122
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/tft"
2223
"github.com/stretchr/testify/assert"
24+
"github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/testutils"
2325
)
2426

2527
func TestSaferCluster(t *testing.T) {
26-
bpt := tft.NewTFBlueprintTest(t)
28+
bpt := tft.NewTFBlueprintTest(t,
29+
tft.WithRetryableTerraformErrors(testutils.RetryableTransientErrors, 1, 2*time.Minute),
30+
)
2731

2832
bpt.DefineVerify(func(assert *assert.Assertions) {
2933
//Skipping Default Verify as the Verify Stage fails due to change in Client Cert Token

test/integration/sandbox_enabled/sandbox_enabled_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 202-2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -15,15 +15,19 @@ package sandbox_enabled
1515

1616
import (
1717
"testing"
18+
"time"
1819

1920
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/gcloud"
2021
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/golden"
2122
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/tft"
2223
"github.com/stretchr/testify/assert"
24+
"github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/testutils"
2325
)
2426

2527
func TestSandboxEnabled(t *testing.T) {
26-
bpt := tft.NewTFBlueprintTest(t)
28+
bpt := tft.NewTFBlueprintTest(t,
29+
tft.WithRetryableTerraformErrors(testutils.RetryableTransientErrors, 1, 2*time.Minute),
30+
)
2731

2832
bpt.DefineVerify(func(assert *assert.Assertions) {
2933
//Skipping Default Verify as the Verify Stage fails due to change in Client Cert Token

test/integration/shared_vpc/shared_vpc_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2022-2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -15,14 +15,18 @@ package shared_vpc
1515

1616
import (
1717
"testing"
18+
"time"
1819

1920
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/gcloud"
2021
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/tft"
2122
"github.com/stretchr/testify/assert"
23+
"github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/testutils"
2224
)
2325

2426
func TestSharedVPC(t *testing.T) {
25-
bpt := tft.NewTFBlueprintTest(t)
27+
bpt := tft.NewTFBlueprintTest(t,
28+
tft.WithRetryableTerraformErrors(testutils.RetryableTransientErrors, 1, 2*time.Minute),
29+
)
2630

2731
bpt.DefineVerify(func(assert *assert.Assertions) {
2832
//Skipping Default Verify as the Verify Stage fails due to change in Client Cert Token

test/integration/simple_autopilot_private/simple_autopilot_private_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2022-2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -15,15 +15,19 @@ package simple_autopilot_private
1515

1616
import (
1717
"testing"
18+
"time"
1819

1920
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/gcloud"
2021
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/golden"
2122
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/tft"
2223
"github.com/stretchr/testify/assert"
24+
"github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/testutils"
2325
)
2426

2527
func TestSimpleAutopilotPrivate(t *testing.T) {
26-
bpt := tft.NewTFBlueprintTest(t)
28+
bpt := tft.NewTFBlueprintTest(t,
29+
tft.WithRetryableTerraformErrors(testutils.RetryableTransientErrors, 1, 2*time.Minute),
30+
)
2731

2832
bpt.DefineVerify(func(assert *assert.Assertions) {
2933
//Skipping Default Verify as the Verify Stage fails due to change in Client Cert Token

test/integration/simple_autopilot_private_non_default_sa/simple_autopilot_private_non_default_sa_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2022-2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -16,16 +16,21 @@ package simple_autopilot_private_non_default_sa
1616

1717
import (
1818
"testing"
19+
"time"
1920

2021
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/gcloud"
2122
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/tft"
2223
"github.com/stretchr/testify/assert"
24+
"github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/testutils"
2325
"github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/utils"
2426
)
2527

2628
func TestSimpleAutopilotPrivateNonDefaultSA(t *testing.T) {
2729
projectID := utils.GetTestProjectFromSetup(t, 1)
28-
bpt := tft.NewTFBlueprintTest(t, tft.WithVars(map[string]interface{}{"project_id": projectID}))
30+
bpt := tft.NewTFBlueprintTest(t,
31+
tft.WithVars(map[string]interface{}{"project_id": projectID}),
32+
tft.WithRetryableTerraformErrors(testutils.RetryableTransientErrors, 1, 2*time.Minute),
33+
)
2934

3035
bpt.DefineVerify(func(assert *assert.Assertions) {
3136
//Skipping Default Verify as the Verify Stage fails due to change in Client Cert Token

test/integration/simple_autopilot_public/simple_autopiliot_public_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2022-2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -15,15 +15,19 @@ package simple_autopilot_public
1515

1616
import (
1717
"testing"
18+
"time"
1819

1920
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/gcloud"
2021
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/golden"
2122
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/tft"
2223
"github.com/stretchr/testify/assert"
24+
"github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/testutils"
2325
)
2426

2527
func TestSimpleAutopilotPublic(t *testing.T) {
26-
bpt := tft.NewTFBlueprintTest(t)
28+
bpt := tft.NewTFBlueprintTest(t,
29+
tft.WithRetryableTerraformErrors(testutils.RetryableTransientErrors, 1, 2*time.Minute),
30+
)
2731

2832
bpt.DefineVerify(func(assert *assert.Assertions) {
2933
//Skipping Default Verify as the Verify Stage fails due to change in Client Cert Token

test/integration/simple_regional/simple_regional_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2022-2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -15,15 +15,19 @@ package simple_regional
1515

1616
import (
1717
"testing"
18+
"time"
1819

1920
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/gcloud"
2021
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/golden"
2122
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/tft"
2223
"github.com/stretchr/testify/assert"
24+
"github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/testutils"
2325
)
2426

2527
func TestSimpleRegional(t *testing.T) {
26-
bpt := tft.NewTFBlueprintTest(t)
28+
bpt := tft.NewTFBlueprintTest(t,
29+
tft.WithRetryableTerraformErrors(testutils.RetryableTransientErrors, 1, 2*time.Minute),
30+
)
2731

2832
bpt.DefineVerify(func(assert *assert.Assertions) {
2933
//Skipping Default Verify as the Verify Stage fails due to change in Client Cert Token

test/integration/simple_regional_private/simple_regional_private_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2022-2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -15,15 +15,19 @@ package simple_regional_private
1515

1616
import (
1717
"testing"
18+
"time"
1819

1920
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/gcloud"
2021
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/golden"
2122
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/tft"
2223
"github.com/stretchr/testify/assert"
24+
"github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/testutils"
2325
)
2426

2527
func TestSimpleRegionalPrivate(t *testing.T) {
26-
bpt := tft.NewTFBlueprintTest(t)
28+
bpt := tft.NewTFBlueprintTest(t,
29+
tft.WithRetryableTerraformErrors(testutils.RetryableTransientErrors, 1, 2*time.Minute),
30+
)
2731

2832
bpt.DefineVerify(func(assert *assert.Assertions) {
2933
//Skipping Default Verify as the Verify Stage fails due to change in Client Cert Token

test/integration/simple_regional_with_kubeconfig/simple_regional_with_kubeconfig_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2022-2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -15,15 +15,19 @@ package simple_regional_with_kubeconfig
1515

1616
import (
1717
"testing"
18+
"time"
1819

1920
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/gcloud"
2021
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/golden"
2122
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/tft"
2223
"github.com/stretchr/testify/assert"
24+
"github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/testutils"
2325
)
2426

2527
func TestSimpleRegionalWithKubeConfig(t *testing.T) {
26-
bpt := tft.NewTFBlueprintTest(t)
28+
bpt := tft.NewTFBlueprintTest(t,
29+
tft.WithRetryableTerraformErrors(testutils.RetryableTransientErrors, 1, 2*time.Minute),
30+
)
2731

2832
bpt.DefineVerify(func(assert *assert.Assertions) {
2933
//Skipping Default Verify as the Verify Stage fails due to change in Client Cert Token

test/integration/simple_regional_with_networking/simple_regional_with_networking_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2022-2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -15,15 +15,19 @@ package simple_regional_with_networking
1515

1616
import (
1717
"testing"
18+
"time"
1819

1920
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/gcloud"
2021
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/golden"
2122
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/tft"
2223
"github.com/stretchr/testify/assert"
24+
"github.com/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/testutils"
2325
)
2426

2527
func TestSimpleRegionalWithNetworking(t *testing.T) {
26-
bpt := tft.NewTFBlueprintTest(t)
28+
bpt := tft.NewTFBlueprintTest(t,
29+
tft.WithRetryableTerraformErrors(testutils.RetryableTransientErrors, 1, 2*time.Minute),
30+
)
2731

2832
bpt.DefineVerify(func(assert *assert.Assertions) {
2933
//Skipping Default Verify as the Verify Stage fails due to change in Client Cert Token

0 commit comments

Comments
 (0)