Skip to content

Commit

Permalink
test: Refactor Terraform Build Tests (#6013)
Browse files Browse the repository at this point in the history
* test: Refactor Terraform build tests

* test: Refactor Terraform build tests (#5993)

* Change function identifier

* Update terraform testing procedure (#5994)

* test: Refactor Terraform build tests

* Change function identifier

* Fix S3 issues

* Update terraform testing procedure (#5995)

* test: Refactor Terraform build tests

* Change function identifier

* Fix S3 issues

* Test Windows all Terraform tests

* Update terraform testing procedure (#5996)

* test: Refactor Terraform build tests

* Change function identifier

* Fix S3 issues

* Test Windows all Terraform tests

* Fix appveyor config

* Install terraform

* Test parallel build single thread

* Refactor Terraform build integration tests

* Update appveyor jobs

* Fix linter error

* Fix other tests issue

* Run build during setup
  • Loading branch information
mildaniel authored Oct 3, 2023
1 parent 1293e0f commit 0689160
Show file tree
Hide file tree
Showing 14 changed files with 2,560 additions and 526 deletions.
79 changes: 4 additions & 75 deletions appveyor-linux-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ image:

configuration:
- BuildIntegTesting
- LocalZipTerraformBuildIntegTesting
- LocalZipTerraformBuildInContainerIntegTesting
- S3ZipTerraformBuildIntegTesting
- S3ZipTerraformBuildInContainerIntegTesting
- OtherTerraformBuildIntegTesting
- AllTerraformBuildTesting
- DeployIntegTesting
- PackageIntegTesting
- DeleteIntegTesting
Expand Down Expand Up @@ -179,79 +175,11 @@ for:
- sh: "JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64"
- sh: "pytest -vv tests/integration/buildcmd/test_build_cmd.py -k test_building_java11_in_process --json-report --json-report-file=TEST_REPORT-integration-buildcmd-java11.json"

# Local ZIP Terraform Build integ testing
# Integ testing Terraform build
-
matrix:
only:
- configuration: LocalZipTerraformBuildIntegTesting

test_script:
# install Terraform
- sh: "sudo apt update --allow-releaseinfo-change"
- sh: "TER_VER=`curl -s https://api.github.com/repos/hashicorp/terraform/releases/latest | grep tag_name | cut -d: -f2 | tr -d \\\"\\,\\v | awk '{$1=$1};1'`"
- sh: "wget https://releases.hashicorp.com/terraform/${TER_VER}/terraform_${TER_VER}_linux_amd64.zip -P /tmp"
- sh: "sudo unzip -d /opt/terraform /tmp/terraform_${TER_VER}_linux_amd64.zip"
- sh: "sudo mv /opt/terraform/terraform /usr/local/bin/"
- sh: "terraform -version"

- sh: "pytest -vv -n 4 tests/integration/buildcmd/test_build_terraform_applications.py::TestBuildTerraformApplicationsWithZipBasedLambdaFunctionAndLocalBackend_0 --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# Local ZIP Terraform Build In Container integ testing
-
matrix:
only:
- configuration: LocalZipTerraformBuildInContainerIntegTesting

test_script:
# install Terraform
- sh: "sudo apt update --allow-releaseinfo-change"
- sh: "TER_VER=`curl -s https://api.github.com/repos/hashicorp/terraform/releases/latest | grep tag_name | cut -d: -f2 | tr -d \\\"\\,\\v | awk '{$1=$1};1'`"
- sh: "wget https://releases.hashicorp.com/terraform/${TER_VER}/terraform_${TER_VER}_linux_amd64.zip -P /tmp"
- sh: "sudo unzip -d /opt/terraform /tmp/terraform_${TER_VER}_linux_amd64.zip"
- sh: "sudo mv /opt/terraform/terraform /usr/local/bin/"
- sh: "terraform -version"

- sh: "pytest -vv -n 4 tests/integration/buildcmd/test_build_terraform_applications.py::TestBuildTerraformApplicationsWithZipBasedLambdaFunctionAndLocalBackend_1 --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# S3 ZIP Terraform Build integ testing
-
matrix:
only:
- configuration: S3ZipTerraformBuildIntegTesting

test_script:
# install Terraform
- sh: "sudo apt update --allow-releaseinfo-change"
- sh: "TER_VER=`curl -s https://api.github.com/repos/hashicorp/terraform/releases/latest | grep tag_name | cut -d: -f2 | tr -d \\\"\\,\\v | awk '{$1=$1};1'`"
- sh: "wget https://releases.hashicorp.com/terraform/${TER_VER}/terraform_${TER_VER}_linux_amd64.zip -P /tmp"
- sh: "sudo unzip -d /opt/terraform /tmp/terraform_${TER_VER}_linux_amd64.zip"
- sh: "sudo mv /opt/terraform/terraform /usr/local/bin/"
- sh: "terraform -version"

- sh: "pytest -vv -n 4 tests/integration/buildcmd/test_build_terraform_applications.py::TestBuildTerraformApplicationsWithZipBasedLambdaFunctionAndS3Backend_0 --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# S3 ZIP Terraform Build In Container integ testing
-
matrix:
only:
- configuration: S3ZipTerraformBuildInContainerIntegTesting

test_script:
# install Terraform
- sh: "sudo apt update --allow-releaseinfo-change"
- sh: "TER_VER=`curl -s https://api.github.com/repos/hashicorp/terraform/releases/latest | grep tag_name | cut -d: -f2 | tr -d \\\"\\,\\v | awk '{$1=$1};1'`"
- sh: "wget https://releases.hashicorp.com/terraform/${TER_VER}/terraform_${TER_VER}_linux_amd64.zip -P /tmp"
- sh: "sudo unzip -d /opt/terraform /tmp/terraform_${TER_VER}_linux_amd64.zip"
- sh: "sudo mv /opt/terraform/terraform /usr/local/bin/"
- sh: "terraform -version"

- sh: "pytest -vv -n 4 tests/integration/buildcmd/test_build_terraform_applications.py::TestBuildTerraformApplicationsWithZipBasedLambdaFunctionAndS3Backend_1 --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# Other Terraform Build In Container integ testing
-
matrix:
only:
- configuration: OtherTerraformBuildIntegTesting
- configuration: AllTerraformBuildTesting

test_script:
# install Terraform
Expand All @@ -262,6 +190,7 @@ for:
- sh: "sudo mv /opt/terraform/terraform /usr/local/bin/"
- sh: "terraform -version"

- sh: "pytest -vv -n 4 tests/integration/buildcmd/test_build_terraform_applications.py --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"
- sh: "pytest -vv -n 4 tests/integration/buildcmd/test_build_terraform_applications_other_cases.py --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# Integ testing deploy
Expand Down
79 changes: 4 additions & 75 deletions appveyor-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ image:

configuration:
- BuildIntegTesting
- LocalZipTerraformBuildIntegTesting
- LocalZipTerraformBuildInContainerIntegTesting
- S3ZipTerraformBuildIntegTesting
- S3ZipTerraformBuildInContainerIntegTesting
- OtherTerraformBuildIntegTesting
- AllTerraformBuildTesting
- DeployIntegTesting
- PackageIntegTesting
- DeleteIntegTesting
Expand Down Expand Up @@ -167,79 +163,11 @@ for:
- sh: "JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64"
- sh: "pytest -vv tests/integration/buildcmd/test_build_cmd.py -k test_building_java11_in_process --json-report --json-report-file=TEST_REPORT-integration-buildcmd-java11.json"

# Local ZIP Terraform Build integ testing
# Integ testing Terraform build
-
matrix:
only:
- configuration: LocalZipTerraformBuildIntegTesting

test_script:
# install Terraform
- sh: "sudo apt update --allow-releaseinfo-change"
- sh: "TER_VER=`curl -s https://api.github.com/repos/hashicorp/terraform/releases/latest | grep tag_name | cut -d: -f2 | tr -d \\\"\\,\\v | awk '{$1=$1};1'`"
- sh: "wget https://releases.hashicorp.com/terraform/${TER_VER}/terraform_${TER_VER}_linux_amd64.zip -P /tmp"
- sh: "sudo unzip -d /opt/terraform /tmp/terraform_${TER_VER}_linux_amd64.zip"
- sh: "sudo mv /opt/terraform/terraform /usr/local/bin/"
- sh: "terraform -version"

- sh: "pytest -vv -n 4 tests/integration/buildcmd/test_build_terraform_applications.py::TestBuildTerraformApplicationsWithZipBasedLambdaFunctionAndLocalBackend_0 --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# Local ZIP Terraform Build In Container integ testing
-
matrix:
only:
- configuration: LocalZipTerraformBuildInContainerIntegTesting

test_script:
# install Terraform
- sh: "sudo apt update --allow-releaseinfo-change"
- sh: "TER_VER=`curl -s https://api.github.com/repos/hashicorp/terraform/releases/latest | grep tag_name | cut -d: -f2 | tr -d \\\"\\,\\v | awk '{$1=$1};1'`"
- sh: "wget https://releases.hashicorp.com/terraform/${TER_VER}/terraform_${TER_VER}_linux_amd64.zip -P /tmp"
- sh: "sudo unzip -d /opt/terraform /tmp/terraform_${TER_VER}_linux_amd64.zip"
- sh: "sudo mv /opt/terraform/terraform /usr/local/bin/"
- sh: "terraform -version"

- sh: "pytest -vv -n 4 tests/integration/buildcmd/test_build_terraform_applications.py::TestBuildTerraformApplicationsWithZipBasedLambdaFunctionAndLocalBackend_1 --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# S3 ZIP Terraform Build integ testing
-
matrix:
only:
- configuration: S3ZipTerraformBuildIntegTesting

test_script:
# install Terraform
- sh: "sudo apt update --allow-releaseinfo-change"
- sh: "TER_VER=`curl -s https://api.github.com/repos/hashicorp/terraform/releases/latest | grep tag_name | cut -d: -f2 | tr -d \\\"\\,\\v | awk '{$1=$1};1'`"
- sh: "wget https://releases.hashicorp.com/terraform/${TER_VER}/terraform_${TER_VER}_linux_amd64.zip -P /tmp"
- sh: "sudo unzip -d /opt/terraform /tmp/terraform_${TER_VER}_linux_amd64.zip"
- sh: "sudo mv /opt/terraform/terraform /usr/local/bin/"
- sh: "terraform -version"

- sh: "pytest -vv -n 4 tests/integration/buildcmd/test_build_terraform_applications.py::TestBuildTerraformApplicationsWithZipBasedLambdaFunctionAndS3Backend_0 --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# S3 ZIP Terraform Build In Container integ testing
-
matrix:
only:
- configuration: S3ZipTerraformBuildInContainerIntegTesting

test_script:
# install Terraform
- sh: "sudo apt update --allow-releaseinfo-change"
- sh: "TER_VER=`curl -s https://api.github.com/repos/hashicorp/terraform/releases/latest | grep tag_name | cut -d: -f2 | tr -d \\\"\\,\\v | awk '{$1=$1};1'`"
- sh: "wget https://releases.hashicorp.com/terraform/${TER_VER}/terraform_${TER_VER}_linux_amd64.zip -P /tmp"
- sh: "sudo unzip -d /opt/terraform /tmp/terraform_${TER_VER}_linux_amd64.zip"
- sh: "sudo mv /opt/terraform/terraform /usr/local/bin/"
- sh: "terraform -version"

- sh: "pytest -vv -n 4 tests/integration/buildcmd/test_build_terraform_applications.py::TestBuildTerraformApplicationsWithZipBasedLambdaFunctionAndS3Backend_1 --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# Other Terraform Build In Container integ testing
-
matrix:
only:
- configuration: OtherTerraformBuildIntegTesting
- configuration: AllTerraformBuildTesting

test_script:
# install Terraform
Expand All @@ -250,6 +178,7 @@ for:
- sh: "sudo mv /opt/terraform/terraform /usr/local/bin/"
- sh: "terraform -version"

- sh: "pytest -vv -n 4 tests/integration/buildcmd/test_build_terraform_applications.py --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"
- sh: "pytest -vv -n 4 tests/integration/buildcmd/test_build_terraform_applications_other_cases.py --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# Integ testing deploy
Expand Down
59 changes: 4 additions & 55 deletions appveyor-windows-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ clone_folder: C:\source

configuration:
- BuildIntegTesting
- LocalZipTerraformBuildIntegTesting
- LocalZipTerraformBuildInContainerIntegTesting
- S3ZipTerraformBuildIntegTesting
- S3ZipTerraformBuildInContainerIntegTesting
- OtherTerraformBuildIntegTesting
- AllTerraformBuildTesting
- DeployIntegTesting
- PackageIntegTesting
- DeleteIntegTesting
Expand Down Expand Up @@ -203,64 +199,17 @@ for:
test_script:
- ps: "pytest -vv tests/integration/buildcmd --ignore tests/integration/buildcmd/test_build_terraform_applications.py --ignore=tests/integration/buildcmd/test_build_terraform_applications_other_cases.py --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# Local ZIP Terraform Build integ testing
#Integ testing Terraform build
- matrix:
only:
- configuration: LocalZipTerraformBuildIntegTesting

test_script:
# install Terraform CLI
- "choco install terraform"
- "terraform -version"

- ps: "pytest -vv -n 4 tests/integration/buildcmd/test_build_terraform_applications.py::TestBuildTerraformApplicationsWithZipBasedLambdaFunctionAndLocalBackend_0 --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# Local ZIP Terraform Build In Container integ testing
- matrix:
only:
- configuration: LocalZipTerraformBuildInContainerIntegTesting

test_script:
# install Terraform CLI
- "choco install terraform"
- "terraform -version"

- ps: "pytest -vv tests/integration/buildcmd/test_build_terraform_applications.py::TestBuildTerraformApplicationsWithZipBasedLambdaFunctionAndLocalBackend_1 --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# S3 ZIP Terraform Build integ testing
- matrix:
only:
- configuration: S3ZipTerraformBuildIntegTesting

test_script:
# install Terraform CLI
- "choco install terraform"
- "terraform -version"

- ps: "pytest -vv -n 4 tests/integration/buildcmd/test_build_terraform_applications.py::TestBuildTerraformApplicationsWithZipBasedLambdaFunctionAndS3Backend_0 --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# S3 ZIP Terraform Build In Container integ testing
- matrix:
only:
- configuration: S3ZipTerraformBuildInContainerIntegTesting

test_script:
# install Terraform CLI
- "choco install terraform"
- "terraform -version"

- ps: "pytest -vv tests/integration/buildcmd/test_build_terraform_applications.py::TestBuildTerraformApplicationsWithZipBasedLambdaFunctionAndS3Backend_1 --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# Other Terraform Build integ testing
- matrix:
only:
- configuration: OtherTerraformBuildIntegTesting
- configuration: AllTerraformBuildTesting

test_script:
# install Terraform CLI
- "choco install terraform"
- "terraform -version"

- ps: "pytest -vv -n 4 tests/integration/buildcmd/test_build_terraform_applications.py --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"
- ps: "pytest -vv -n 4 tests/integration/buildcmd/test_build_terraform_applications_other_cases.py --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

#Integ testing deploy
Expand Down
67 changes: 4 additions & 63 deletions appveyor-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ clone_folder: C:\source

configuration:
- BuildIntegTesting
- LocalZipTerraformBuildIntegTesting
- LocalZipTerraformBuildInContainerIntegTesting
- S3ZipTerraformBuildIntegTesting
- S3ZipTerraformBuildInContainerIntegTesting
- OtherTerraformBuildIntegTesting
- AllTerraformBuildTesting
- DeployIntegTesting
- PackageIntegTesting
- DeleteIntegTesting
Expand Down Expand Up @@ -194,74 +190,19 @@ for:
test_script:
- ps: "pytest -vv tests/integration/buildcmd --ignore tests/integration/buildcmd/test_build_terraform_applications.py --ignore=tests/integration/buildcmd/test_build_terraform_applications_other_cases.py --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# Local ZIP Terraform Build integ testing
#Integ testing Terraform build
- matrix:
only:
- configuration: LocalZipTerraformBuildIntegTesting

test_script:
# install Terraform CLI
- "choco install terraform"
- "terraform -version"

- ps: "pytest -vv -n 4 tests/integration/buildcmd/test_build_terraform_applications.py::TestBuildTerraformApplicationsWithZipBasedLambdaFunctionAndLocalBackend_0 --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# Local ZIP Terraform Build In Container integ testing
- matrix:
only:
- configuration: LocalZipTerraformBuildInContainerIntegTesting

test_script:
# install Terraform CLI
- "choco install terraform"
- "terraform -version"

- ps: "pytest -vv tests/integration/buildcmd/test_build_terraform_applications.py::TestBuildTerraformApplicationsWithZipBasedLambdaFunctionAndLocalBackend_1 --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# S3 ZIP Terraform Build integ testing
- matrix:
only:
- configuration: S3ZipTerraformBuildIntegTesting

test_script:
# install Terraform CLI
- "choco install terraform"
- "terraform -version"

- ps: "pytest -vv -n 4 tests/integration/buildcmd/test_build_terraform_applications.py::TestBuildTerraformApplicationsWithZipBasedLambdaFunctionAndS3Backend_0 --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# S3 ZIP Terraform Build In Container integ testing
- matrix:
only:
- configuration: S3ZipTerraformBuildInContainerIntegTesting

test_script:
# install Terraform CLI
- "choco install terraform"
- "terraform -version"

- ps: "pytest -vv tests/integration/buildcmd/test_build_terraform_applications.py::TestBuildTerraformApplicationsWithZipBasedLambdaFunctionAndS3Backend_1 --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# Other Terraform Build integ testing
- matrix:
only:
- configuration: OtherTerraformBuildIntegTesting
- configuration: AllTerraformBuildTesting

test_script:
# install Terraform CLI
- "choco install terraform"
- "terraform -version"

- ps: "pytest -vv -n 4 tests/integration/buildcmd/test_build_terraform_applications.py --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"
- ps: "pytest -vv -n 4 tests/integration/buildcmd/test_build_terraform_applications_other_cases.py --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

#Integ testing deploy
- matrix:
only:
- configuration: DeployIntegTesting

test_script:
- ps: "pytest -vv tests/integration/deploy -n 4 --reruns 4 --dist=loadgroup --json-report --json-report-file=TEST_REPORT-integration-deploy.json"

# Integ testing package
- matrix:
only:
Expand Down
Loading

0 comments on commit 0689160

Please sign in to comment.