Skip to content

Commit

Permalink
CXF:88606 GHA UAT Port Connectivity terra tests (#43)
Browse files Browse the repository at this point in the history
* feat: Adding GHA workflow for Terra tests

* feat: Adding new terratests for port-2port connection and updating variables

* misc: removing cloud router changes from the PR

* misc: fixing UAT terra-tests workflow

* misc: Adding versions file to uat/tests examples

* fix: Updating UAT tests workflow and moving terra tests under one file

* fix: Appending Secret values directly to the file in UAT workflow

* fix: fixing setup variables files job in UAT workflow

* fix: deleting old terra tests files

* nit: fixing indentation

* misc:Updating workflow file

* misc:reverting the latest change in UAT workflow

* misc:Updating UAT workflow file and variable files

* fix: Updating variables files for examples

* fix: Adding project_id block in connection modules & examples

* fix: Adding project_id varaible in IBM2 example
  • Loading branch information
srushti-patl authored Mar 21, 2024
1 parent 2e71cca commit 3e42275
Show file tree
Hide file tree
Showing 47 changed files with 1,581 additions and 43 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/terratests-uat-suite.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: terratests-uat-suite

on:
pull_request:
workflow_dispatch:

jobs:
setup-tests:
name: Setup UAT Tests
runs-on: ubuntu-latest
env:
EQUINIX_API_ENDPOINT: "https://uatapi.equinix.com"
TEST_DATA_UAT_PORT_2_ALIBABA_CONNECTION: ${{ secrets.TEST_DATA_UAT_PORT_2_ALIBABA_CONNECTION }}
TEST_DATA_UAT_PORT_2_AWS_CONNECTION: ${{ secrets.TEST_DATA_UAT_PORT_2_AWS_CONNECTION }}
TEST_DATA_UAT_PORT_2_AZURE_CONNECTION: ${{ secrets.TEST_DATA_UAT_PORT_2_AZURE_CONNECTION }}
TEST_DATA_UAT_PORT_2_IBM2_CONNECTION: ${{ secrets.TEST_DATA_UAT_PORT_2_IBM2_CONNECTION }}
TEST_DATA_UAT_PORT_2_PORT_CONNECTION: ${{ secrets.TEST_DATA_UAT_PORT_2_PORT_CONNECTION }}
TEST_DATA_UAT_PORT_2_PRIVATE_SERVICE_PROFILE_CONNECTION: ${{ secrets.TEST_DATA_UAT_PORT_2_PRIVATE_SERVICE_PROFILE_CONNECTION }}
TEST_DATA_UAT_PORT_2_PUBLIC_SERVICE_PROFILE_CONNECTION: ${{ secrets.TEST_DATA_UAT_PORT_2_PUBLIC_SERVICE_PROFILE_CONNECTION }}

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: './go.mod'
id: go

- name: Get dependencies
run: |
go mod download
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ matrix.terraform }}
terraform_wrapper: false

- name: Setup Variables Files
run: |
echo $TEST_DATA_UAT_PORT_2_ALIBABA_CONNECTION >> "./examples/port-2-alibaba-connection/terraform.tfvars.json"
echo $TEST_DATA_UAT_PORT_2_AWS_CONNECTION >> "./tests/uat/port-2-aws-connection/terraform.tfvars.json"
echo $TEST_DATA_UAT_PORT_2_AZURE_CONNECTION >> "./tests/uat/port-2-azure-connection/terraform.tfvars.json"
echo $TEST_DATA_UAT_PORT_2_IBM2_CONNECTION >> "./examples/port-2-ibm2-connection/terraform.tfvars.json"
echo $TEST_DATA_UAT_PORT_2_PORT_CONNECTION >> "./examples/port-2-port-connection/terraform.tfvars.json"
echo $TEST_DATA_UAT_PORT_2_PRIVATE_SERVICE_PROFILE_CONNECTION >> "./examples/port-2-private-service-profile-connection/terraform.tfvars.json"
echo $TEST_DATA_UAT_PORT_2_PUBLIC_SERVICE_PROFILE_CONNECTION >> "./examples/port-2-public-service-profile-connection/terraform.tfvars.json"
- name: Run Go Tests
run:
go test ./tests/uat -v -coverprofile coverage_uat_modules.txt -covermode=atomic -count 1 -parallel 8 -timeout 180m

- name: Setup Node.js 20.11.1
uses: actions/setup-node@v2
with:
node-version: 20.11.1

- name: Upload test coverage to Codecov
if: ${{ always() }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage_uat_modules.txt
6 changes: 5 additions & 1 deletion examples/cloud-router-2-aws-connection/variables.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
variable "equinix_client_id" {
description = "Equinix client ID (consumer key), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "equinix_client_secret" {
description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "connection_name" {
description = "Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores"
Expand Down Expand Up @@ -44,7 +46,7 @@ variable "aside_fcr_uuid" {
variable "zside_ap_authentication_key" {
description = "Authentication key for provider based connections"
type = string
default = ""
sensitive = true
}
variable "zside_ap_type" {
description = "Access point type - COLO, VD, VG, SP, IGW, SUBNET, GW"
Expand Down Expand Up @@ -75,6 +77,7 @@ variable "additional_info" {
description = "Additional parameters required for some service profiles. It should be a list of maps containing 'key' and 'value e.g. `[{ key='asn' value = '65000'}, { key='ip' value = '192.168.0.1'}]`"
type = list(object({ key = string, value = string }))
default = []
sensitive = true
}
variable "aws_vif_name" {
description = "The name for the virtual interface"
Expand Down Expand Up @@ -102,6 +105,7 @@ variable "aws_vif_bgp_auth_key" {
description = "The authentication key for BGP configuration"
type = string
default = ""
sensitive = true
}
variable "aws_gateway_name" {
description = "The name of the Gateway"
Expand Down
7 changes: 6 additions & 1 deletion examples/cloud-router-2-azure-connection/variables.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
variable "equinix_client_id" {
description = "Equinix client ID (consumer key), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "equinix_client_secret" {
description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "connection_name" {
description = "Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores"
Expand Down Expand Up @@ -60,7 +62,6 @@ variable "zside_peering_type" {
description = "Access point peering type - PRIVATE, MICROSOFT, PUBLIC, MANUAL"
default = "PRIVATE"
}

variable "zside_fabric_sp_name" {
description = "Equinix Service Profile Name"
type = string
Expand All @@ -69,18 +70,22 @@ variable "zside_fabric_sp_name" {
variable "azure_client_id" {
description = "Azure Client id"
type = string
sensitive = true
}
variable "azure_client_secret" {
description = "Azure Secret value"
type = string
sensitive = true
}
variable "azure_tenant_id" {
description = "Azure Tenant id"
type = string
sensitive = true
}
variable "azure_subscription_id" {
description = "Azure Subscription id"
type = string
sensitive = true
}
variable "azure_resource_name" {
description = "The name of Azure Resource"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
variable "equinix_client_id" {
description = "Equinix client ID (consumer key), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "equinix_client_secret" {
description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "connection_name" {
description = "Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores"
Expand Down Expand Up @@ -33,7 +35,6 @@ variable "purchase_order_number" {
type = string
default = ""
}

variable "aside_ap_type" {
description = "Access point type - COLO, VD, VG, SP, IGW, SUBNET, GW"
type = string
Expand Down Expand Up @@ -84,18 +85,22 @@ variable "secondary_redundancy" {
variable "azure_client_id" {
description = "Azure Client id"
type = string
sensitive = true
}
variable "azure_client_secret" {
description = "Azure Secret value"
type = string
sensitive = true
}
variable "azure_tenant_id" {
description = "Azure Tenant id"
type = string
sensitive = true
}
variable "azure_subscription_id" {
description = "Azure Subscription id"
type = string
sensitive = true
}
variable "azure_resource_name" {
description = "The name of Azure Resource"
Expand Down
2 changes: 2 additions & 0 deletions examples/cloud-router-2-google-connection/variables.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
variable "equinix_client_id" {
description = "Equinix client ID (consumer key), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "equinix_client_secret" {
description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform"
type = string
sensitive = true
}
#Google Provider
variable "google_region" {
Expand Down
4 changes: 3 additions & 1 deletion examples/cloud-router-2-oracle-connection/variables.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
variable "equinix_client_id" {
description = "Equinix client ID (consumer key), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "equinix_client_secret" {
description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "connection_name" {
description = "Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores"
Expand Down Expand Up @@ -44,7 +46,7 @@ variable "aside_fcr_uuid" {
variable "zside_ap_authentication_key" {
description = "Authentication key for provider based connections"
type = string
default = ""
sensitive = true
}
variable "zside_ap_type" {
description = "Access point type - COLO, VD, VG, SP, IGW, SUBNET, GW"
Expand Down
2 changes: 1 addition & 1 deletion examples/cloud-router-2-port-connection/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
output "module_output" {
output "port_connection_id" {
value = module.cloud_router_port_connection.primary_connection_id
}
2 changes: 2 additions & 0 deletions examples/cloud-router-2-port-connection/variables.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
variable "equinix_client_id" {
description = "Equinix client ID (consumer key), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "equinix_client_secret" {
description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "connection_name" {
description = "Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
output "module_output" {
output "service_profile_connection_id" {
value = module.cloud_router_sp_connection.primary_connection_id
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
variable "equinix_client_id" {
description = "Equinix client ID (consumer key), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "equinix_client_secret" {
description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "connection_name" {
description = "Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores"
Expand Down
2 changes: 2 additions & 0 deletions examples/cloud-router-2-wan-connection/variables.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
variable "equinix_client_id" {
description = "Equinix client ID (consumer key), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "equinix_client_secret" {
description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "connection_name" {
description = "Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores"
Expand Down
1 change: 1 addition & 0 deletions examples/port-2-alibaba-connection/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module "create_port_2_alibaba_connection" {
notifications_emails = var.notifications_emails
bandwidth = var.bandwidth
purchase_order_number = var.purchase_order_number
project_id = var.project_id

# A-side
aside_port_name = var.aside_port_name
Expand Down
11 changes: 8 additions & 3 deletions examples/port-2-alibaba-connection/variables.tf
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
variable "equinix_client_id" {
description = "Equinix client ID (consumer key), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "equinix_client_secret" {
description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform"
type = string
sensitive = true
}

variable "connection_name" {
description = "Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores"
type = string
}
variable "project_id" {
description = "Subscriber-assigned project ID"
type = string
default = ""
}
variable "connection_type" {
description = "Defines the connection type like VG_VC, EVPL_VC, EPL_VC, EC_VC, IP_VC, ACCESS_EPL_VC"
type = string
Expand All @@ -33,12 +39,10 @@ variable "purchase_order_number" {
type = string
default = ""
}

variable "aside_port_name" {
description = "Equinix A-Side Port Name"
type = string
}

variable "aside_vlan_tag" {
description = "Vlan Tag information, outer vlanSTag for QINQ connections"
type = string
Expand All @@ -55,6 +59,7 @@ variable "zside_ap_type" {
variable "zside_ap_authentication_key" {
description = "Authentication key for provider based connections"
type = string
sensitive = true
}
variable "zside_ap_profile_type" {
description = "Service profile type - L2_PROFILE, L3_PROFILE, ECIA_PROFILE, ECMC_PROFILE"
Expand Down
5 changes: 5 additions & 0 deletions examples/port-2-aws-connection/variables.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
variable "equinix_client_id" {
description = "Equinix client ID (consumer key), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "equinix_client_secret" {
description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "connection_name" {
description = "Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores"
Expand Down Expand Up @@ -52,6 +54,7 @@ variable "zside_ap_type" {
variable "zside_ap_authentication_key" {
description = "Authentication key for provider based connections"
type = string
sensitive = true
}
variable "zside_ap_profile_type" {
description = "Service profile type - L2_PROFILE, L3_PROFILE, ECIA_PROFILE, ECMC_PROFILE"
Expand All @@ -73,6 +76,7 @@ variable "additional_info" {
description = "Additional info parameters. It's a list of maps containing 'key' and 'value' keys with their corresponding values."
type = list(object({ key = string, value = string }))
default = []
sensitive = true
}
variable "aws_vif_name" {
description = "The name for the virtual interface"
Expand Down Expand Up @@ -100,6 +104,7 @@ variable "aws_vif_bgp_auth_key" {
description = "The authentication key for BGP configuration"
type = string
default = ""
sensitive = true
}
variable "aws_gateway_name" {
description = "The name of the Gateway"
Expand Down
Loading

0 comments on commit 3e42275

Please sign in to comment.