Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Refactor Terraform Build Tests #6013

Merged
merged 23 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fff4382
test: Refactor Terraform build tests
mildaniel Sep 27, 2023
e872dc5
test: Refactor Terraform build tests (#5993)
mildaniel Sep 27, 2023
a27a7b0
Change function identifier
mildaniel Sep 27, 2023
d565884
Resolve conflicts
mildaniel Sep 27, 2023
dea2235
Update terraform testing procedure (#5994)
mildaniel Sep 27, 2023
e911e17
Fix S3 issues
mildaniel Sep 27, 2023
8c0eaa8
Update terraform testing procedure (#5995)
mildaniel Sep 27, 2023
938d42f
Test Windows all Terraform tests
mildaniel Sep 27, 2023
8a934c5
Update terraform testing procedure (#5996)
mildaniel Sep 27, 2023
1fde090
Fix appveyor config
mildaniel Sep 27, 2023
bfe203b
Merge branch 'develop' of github.com:aws/aws-sam-cli into update-terr…
mildaniel Sep 27, 2023
6c53e8b
Resolve conflicts
mildaniel Sep 27, 2023
71b9b59
Install terraform
mildaniel Sep 27, 2023
5d593dc
Test parallel build single thread
mildaniel Sep 27, 2023
8a7e7f1
Refactor Terraform build integration tests
mildaniel Sep 29, 2023
90a61e7
Update appveyor jobs
mildaniel Sep 29, 2023
14ef376
Merge branch 'develop' into update-terraform-testing-procedure
mildaniel Sep 29, 2023
a1bdece
Fix linter error
mildaniel Sep 29, 2023
ebee306
Merge branch 'update-terraform-testing-procedure' of github.com:milda…
mildaniel Sep 29, 2023
3f4f0c8
Fix other tests issue
mildaniel Sep 30, 2023
2468f55
Run build during setup
mildaniel Sep 30, 2023
f4d5dea
Merge branch 'develop' into update-terraform-testing-procedure
mildaniel Oct 3, 2023
a3719e8
Merge branch 'develop' into update-terraform-testing-procedure
mildaniel Oct 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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