Skip to content

Commit

Permalink
Merge pull request gruntwork-io#1237 from gruntwork-io/bug/helm-chart…
Browse files Browse the repository at this point in the history
…-install-fix-2417

gruntwork-io#1233 Failing tests fixes
  • Loading branch information
denis256 authored Feb 9, 2023
2 parents e1570b5 + a4c8231 commit 9509a64
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
10 changes: 5 additions & 5 deletions modules/gcp/compute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ const DEFAULT_MACHINE_TYPE = "f1-micro"
const DEFAULT_IMAGE_FAMILY_PROJECT_NAME = "ubuntu-os-cloud"
const DEFAULT_IMAGE_FAMILY_NAME = "family/ubuntu-1804-lts"

// Regions that don't support running f1-micro instances
var RegionsToAvoid = []string{"asia-east2", "southamerica-west1", "europe-west8", "europe-southwest1"}
// Zones that support running f1-micro instances
var ZonesThatSupportF1Micro = []string{"us-central1-a", "us-east1-b", "us-west1-a", "europe-north1-a", "europe-west1-b", "europe-central2-a"}

func TestGetPublicIpOfInstance(t *testing.T) {
t.Parallel()

instanceName := RandomValidGcpName()
projectID := GetGoogleProjectIDFromEnvVar(t)
zone := GetRandomZone(t, projectID, nil, nil, RegionsToAvoid)
zone := GetRandomZone(t, projectID, ZonesThatSupportF1Micro, nil, nil)

createComputeInstance(t, projectID, zone, instanceName)
defer deleteComputeInstance(t, projectID, zone, instanceName)
Expand Down Expand Up @@ -77,7 +77,7 @@ func TestGetAndSetLabels(t *testing.T) {
instanceName := RandomValidGcpName()
projectID := GetGoogleProjectIDFromEnvVar(t)

zone := GetRandomZone(t, projectID, nil, nil, RegionsToAvoid)
zone := GetRandomZone(t, projectID, ZonesThatSupportF1Micro, nil, nil)

createComputeInstance(t, projectID, zone, instanceName)
defer deleteComputeInstance(t, projectID, zone, instanceName)
Expand Down Expand Up @@ -113,7 +113,7 @@ func TestGetAndSetMetadata(t *testing.T) {
projectID := GetGoogleProjectIDFromEnvVar(t)
instanceName := RandomValidGcpName()

zone := GetRandomZone(t, projectID, nil, nil, RegionsToAvoid)
zone := GetRandomZone(t, projectID, ZonesThatSupportF1Micro, nil, nil)

// Create a new Compute Instance
createComputeInstance(t, projectID, zone, instanceName)
Expand Down
2 changes: 1 addition & 1 deletion modules/helm/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
const (
remoteChartSource = "https://charts.bitnami.com/bitnami"
remoteChartName = "nginx"
remoteChartVersion = "9.7.4"
remoteChartVersion = "13.2.23"
)

// Test that we can install a remote chart (e.g bitnami/nginx)
Expand Down
9 changes: 6 additions & 3 deletions test/gcp/packer_gcp_basic_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ var DefaultRetryablePackerErrors = map[string]string{
}
var DefaultTimeBetweenPackerRetries = 15 * time.Second

// Regions that don't support n1-standard-1 instances
var RegionsToAvoid = []string{"asia-east2", "southamerica-west1", "europe-west8", "europe-southwest1"}
// Regions that support running f1-micro instances
var RegionsThatSupportF1Micro = []string{"us-central1", "us-east1", "us-west1", "europe-west1"}

// Zones that support running f1-micro instances
var ZonesThatSupportF1Micro = []string{"us-central1-a", "us-east1-b", "us-west1-a", "europe-north1-a", "europe-west1-b", "europe-central2-a"}

const DefaultMaxPackerRetries = 3

Expand All @@ -35,7 +38,7 @@ func TestPackerGCPBasicExample(t *testing.T) {
projectID := gcp.GetGoogleProjectIDFromEnvVar(t)

// Pick a random GCP zone to test in. This helps ensure your code works in all regions.
zone := gcp.GetRandomZone(t, projectID, nil, nil, RegionsToAvoid)
zone := gcp.GetRandomZone(t, projectID, ZonesThatSupportF1Micro, nil, nil)

packerOptions := &packer.Options{
// The path to where the Packer template is located
Expand Down
2 changes: 1 addition & 1 deletion test/gcp/terraform_gcp_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func TestSshAccessToComputeInstance(t *testing.T) {
// Setup values for our Terraform apply
projectID := gcp.GetGoogleProjectIDFromEnvVar(t)
randomValidGcpName := gcp.RandomValidGcpName()
zone := gcp.GetRandomZone(t, projectID, nil, nil, RegionsToAvoid)
zone := gcp.GetRandomZone(t, projectID, ZonesThatSupportF1Micro, nil, nil)

terraformOptions := &terraform.Options{
// The path to where our Terraform code is located
Expand Down
2 changes: 1 addition & 1 deletion test/gcp/terraform_gcp_ig_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestTerraformGcpInstanceGroupExample(t *testing.T) {
// Setup values for our Terraform apply
projectId := gcp.GetGoogleProjectIDFromEnvVar(t)

region := gcp.GetRandomRegion(t, projectId, nil, RegionsToAvoid)
region := gcp.GetRandomRegion(t, projectId, RegionsThatSupportF1Micro, nil)

randomValidGcpName := gcp.RandomValidGcpName()
clusterSize := 3
Expand Down

0 comments on commit 9509a64

Please sign in to comment.