Skip to content

Commit

Permalink
Update the GHA Path to fix Run Tests Separately
Browse files Browse the repository at this point in the history
  • Loading branch information
jkallem-equinix committed Aug 9, 2024
1 parent 60c8a6e commit b99d992
Show file tree
Hide file tree
Showing 6 changed files with 345 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/terratests-fcr-prod-suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Run Go Tests
run:
go test ./tests/prod -v -coverprofile coverage_prod_modules.txt -covermode=atomic -count 1 -parallel 8 -run "(DIGP)" -timeout 180m
go test ./tests/prod/cloud-router -v -coverprofile coverage_prod_modules.txt -covermode=atomic -count 1 -parallel 8 -run "(DIGP)" -timeout 180m

- name: Upload test coverage to Codecov
if: ${{ always() }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/terratests-port-prod-suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Run Go Tests
run:
go test ./tests/prod -v -coverprofile coverage_prod_modules.txt -covermode=atomic -count 1 -parallel 8 -run "(DIGP)" -timeout 180m
go test ./tests/prod/port -v -coverprofile coverage_prod_modules.txt -covermode=atomic -count 1 -parallel 8 -run "(DIGP)" -timeout 180m

- name: Upload test coverage to Codecov
if: ${{ always() }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/terratests-virtualdevice-prod-suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Run Go Tests
run:
go test ./tests/prod -v -coverprofile coverage_prod_modules.txt -covermode=atomic -count 1 -parallel 8 -run "(DIGP)" -timeout 180m
go test ./tests/prod/virtual-device -v -coverprofile coverage_prod_modules.txt -covermode=atomic -count 1 -parallel 8 -run "(DIGP)" -timeout 180m

- name: Upload test coverage to Codecov
if: ${{ always() }}
Expand Down
117 changes: 117 additions & 0 deletions tests/prod/cloud-router/prod_sanity_fcr_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
package prod

import (
"github.com/gruntwork-io/terratest/modules/terraform"
"github.com/stretchr/testify/assert"
"testing"
)

func TestCloudRouterCreate_DIGP(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../tests/examples-without-external-providers/cloud-router",
})

defer terraform.Destroy(t, terraformOptions)
t.Parallel()

terraform.InitAndApply(t, terraformOptions)
output := terraform.Output(t, terraformOptions, "cloud_router_id")
assert.NotNil(t, output)

terraformOptions = terraform.WithDefaultRetryableErrors(t, &terraform.Options{
Vars: map[string]interface{}{
"fcr_name": "FCR_Name_Update",
},
TerraformDir: "../../tests/examples-without-external-providers/cloud-router",
})
terraform.Apply(t, terraformOptions)
}

func TestCloudRouter2AwsCreateConnection_DIGP(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../tests/examples-without-external-providers/cloud-router-2-aws-connection",
})

defer terraform.Destroy(t, terraformOptions)
t.Parallel()

terraform.InitAndApply(t, terraformOptions)
output := terraform.Output(t, terraformOptions, "aws_connection_id")
assert.NotNil(t, output)
}

func TestCloudRouter2AzureCreateConnection_DIGP(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../tests/examples-without-external-providers/cloud-router-2-azure-connection",
})

defer terraform.Destroy(t, terraformOptions)
t.Parallel()

terraform.InitAndApply(t, terraformOptions)
output := terraform.Output(t, terraformOptions, "azure_connection_id")
assert.NotNil(t, output)
}

func TestCloudRouter2PortRoutingProtocolCreateConnection_DIGP(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../tests/examples-without-external-providers/cloud-router-2-port-routing-protocol-connection",
})

defer terraform.Destroy(t, terraformOptions)
t.Parallel()

terraform.InitAndApply(t, terraformOptions)
output := terraform.Output(t, terraformOptions, "port_connection_id")
assert.NotNil(t, output)

terraformOptions = terraform.WithDefaultRetryableErrors(t, &terraform.Options{
Vars: map[string]interface{}{
"connection_name": "FCR2Port_Name_Update",
"bandwidth": 100,
},
TerraformDir: "../../tests/examples-without-external-providers/cloud-router-2-port-routing-protocol-connection",
})
terraform.Apply(t, terraformOptions)
}

func TestCloudRouter2ServiceProfileCreateConnection_DIGP(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../examples/cloud-router-2-service-profile-connection",
})

defer terraform.Destroy(t, terraformOptions)
t.Parallel()

terraform.InitAndApply(t, terraformOptions)
output := terraform.Output(t, terraformOptions, "service_profile_connection_id")
assert.NotNil(t, output)
}

func TestCloudRouter2WanCreateConnection_DIGP(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../examples/cloud-router-2-wan-connection",
})

defer terraform.Destroy(t, terraformOptions)
t.Parallel()

terraform.InitAndApply(t, terraformOptions)
output := terraform.Output(t, terraformOptions, "wan_connection_id")
assert.NotNil(t, output)

terraformOptions = terraform.WithDefaultRetryableErrors(t, &terraform.Options{
Vars: map[string]interface{}{
"connection_name": "FCR2WAN_Name_Update",
"bandwidth": 50,
},
TerraformDir: "../../examples/cloud-router-2-wan-connection",
})
terraform.Apply(t, terraformOptions)
}
167 changes: 167 additions & 0 deletions tests/prod/port/prod_sanity_port_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
package prod

import (
"github.com/gruntwork-io/terratest/modules/terraform"
"github.com/stretchr/testify/assert"
"testing"
)

func TestPort2AlibabaCreateConnection_DIGP(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../examples/port-2-alibaba-connection",
})

defer terraform.Destroy(t, terraformOptions)
t.Parallel()

terraform.InitAndApply(t, terraformOptions)
output := terraform.Output(t, terraformOptions, "alibaba_connection_id")
assert.NotNil(t, output)
}

func TestPort2AwsCreateConnection_DIGP(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../tests/examples-without-external-providers/port-2-aws-connection",
})

defer terraform.Destroy(t, terraformOptions)
t.Parallel()

terraform.InitAndApply(t, terraformOptions)
output := terraform.Output(t, terraformOptions, "aws_connection_id")
assert.NotNil(t, output)
}

func TestPort2AzureCreateConnection_DIGP(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../tests/examples-without-external-providers/port-2-azure-connection",
})

defer terraform.Destroy(t, terraformOptions)
t.Parallel()

terraform.InitAndApply(t, terraformOptions)
output := terraform.Output(t, terraformOptions, "azure_connection_id")
assert.NotNil(t, output)

terraformOptions = terraform.WithDefaultRetryableErrors(t, &terraform.Options{
Vars: map[string]interface{}{
"connection_name": "P2Azure_Name_Update",
},
TerraformDir: "../../tests/examples-without-external-providers/port-2-azure-connection",
})
terraform.Apply(t, terraformOptions)
}

func TestPort2GoogleCreateConnection_DIGP(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../examples/port-2-google-connection",
})

defer terraform.Destroy(t, terraformOptions)
t.Parallel()

terraform.InitAndApply(t, terraformOptions)
output := terraform.Output(t, terraformOptions, "google_connection_id")
assert.NotNil(t, output)

terraformOptions = terraform.WithDefaultRetryableErrors(t, &terraform.Options{
Vars: map[string]interface{}{
"bandwidth": 100,
},
TerraformDir: "../../examples/port-2-google-connection",
})
terraform.Apply(t, terraformOptions)
}

func TestPort2Ibm2CreateConnection_DIGP(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../examples/port-2-ibm2-connection",
})

defer terraform.Destroy(t, terraformOptions)
t.Parallel()

terraform.InitAndApply(t, terraformOptions)
output := terraform.Output(t, terraformOptions, "ibm2_connection_id")
assert.NotNil(t, output)
}

func TestPort2OracleCreateConnection_DIGP(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../examples/port-2-oracle-connection",
})

defer terraform.Destroy(t, terraformOptions)
t.Parallel()

terraform.InitAndApply(t, terraformOptions)
output := terraform.Output(t, terraformOptions, "oracle_connection_id")
assert.NotNil(t, output)
}

func TestPort2PortCreateConnection_DIGP(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../examples/port-2-port-connection",
})

defer terraform.Destroy(t, terraformOptions)
t.Parallel()

terraform.InitAndApply(t, terraformOptions)
output := terraform.Output(t, terraformOptions, "port_connection_id")
assert.NotNil(t, output)

terraformOptions = terraform.WithDefaultRetryableErrors(t, &terraform.Options{
Vars: map[string]interface{}{
"connection_name": "P2Port_Name_Update",
"bandwidth": 100,
},
TerraformDir: "../../examples/port-2-port-connection",
})
terraform.Apply(t, terraformOptions)
}

func TestPort2PrivateServiceProfileCreateConnection_DIGP(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../examples/port-2-private-service-profile-connection",
})

defer terraform.Destroy(t, terraformOptions)
t.Parallel()

terraform.InitAndApply(t, terraformOptions)
output := terraform.Output(t, terraformOptions, "private_sp_connection_id")
assert.NotNil(t, output)
}

func TestPort2WanCreateConnection_DIGP(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../tests/examples-without-external-providers/port-2-wan-connection",
})

defer terraform.Destroy(t, terraformOptions)
t.Parallel()

terraform.InitAndApply(t, terraformOptions)
output := terraform.Output(t, terraformOptions, "wan_connection_id")
assert.NotNil(t, output)

terraformOptions = terraform.WithDefaultRetryableErrors(t, &terraform.Options{
Vars: map[string]interface{}{
"connection_name": "P2WAN_Name_Update",
"bandwidth": 50,
},
TerraformDir: "../../tests/examples-without-external-providers/port-2-wan-connection",
})
terraform.Apply(t, terraformOptions)
}
58 changes: 58 additions & 0 deletions tests/prod/virtual-device/prod_sanity_vd_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package prod

import (
"github.com/gruntwork-io/terratest/modules/terraform"
"github.com/stretchr/testify/assert"
"testing"
)

func TestVirtualDevice2WanCreateConnection_DIGP(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../tests/examples-without-external-providers/virtual-device-2-wan-connection",
})

defer terraform.Destroy(t, terraformOptions)
t.Parallel()

terraform.InitAndApply(t, terraformOptions)
output := terraform.Output(t, terraformOptions, "wan_connection_id")
assert.NotNil(t, output)
}

func TestVirtualDevice2AzureCreateConnection_DIGP(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../tests/examples-without-external-providers/virtual-device-2-azure-connection",
})

defer terraform.Destroy(t, terraformOptions)
t.Parallel()

terraform.InitAndApply(t, terraformOptions)
output := terraform.Output(t, terraformOptions, "azure_connection_id")
assert.NotNil(t, output)
}

func TestVirtualDevice2PortCreateConnection_DIGP(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../tests/examples-without-external-providers/virtual-device-2-port-connection",
})

defer terraform.Destroy(t, terraformOptions)
t.Parallel()

terraform.InitAndApply(t, terraformOptions)
output := terraform.Output(t, terraformOptions, "port_connection_id")
assert.NotNil(t, output)

terraformOptions = terraform.WithDefaultRetryableErrors(t, &terraform.Options{
Vars: map[string]interface{}{
"connection_name": "VD2Port_Name_Update",
"bandwidth": 10,
},
TerraformDir: "../../tests/examples-without-external-providers/virtual-device-2-port-connection",
})
terraform.Apply(t, terraformOptions)
}

0 comments on commit b99d992

Please sign in to comment.