Skip to content

Commit

Permalink
Merge from aws/aws-sam-cli/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-sam-cli-bot authored Aug 29, 2023
2 parents da9f1b5 + 35b55c6 commit b260034
Show file tree
Hide file tree
Showing 109 changed files with 3,515 additions and 805 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,12 @@ jobs:
3.9
3.8
3.7
- name: Init samdev
run: make init
- name: Stop Docker Linux
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo systemctl stop docker
run: |
: sudo systemctl stop docker
sudo systemctl stop docker.service
sudo systemctl stop docker.socket
- name: Stop Docker Windows
if: ${{ matrix.os == 'windows-latest' }}
shell: pwsh
Expand All @@ -254,5 +255,7 @@ jobs:
- name: Report failure
if: steps.run-docker-info.outcome == 'success'
run: exit 1
- name: Init samdev
run: make init
- name: Run tests without Docker
run: pytest -vv tests/integration/buildcmd/test_build_cmd.py -k TestBuildCommand_PythonFunctions_WithoutDocker
58 changes: 49 additions & 9 deletions appveyor-linux-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ install:
- sh: "./aws_cli/bin/python -m pip install awscli"
- sh: "PATH=$(echo $PWD'/aws_cli/bin'):$PATH"

- sh: "PATH=$PATH:$HOME/venv3.7/bin:$HOME/venv3.8/bin:$HOME/venv3.9/bin:$HOME/venv3.10/bin"
- sh: "PATH=$PATH:$HOME/venv3.7/bin:$HOME/venv3.8/bin:$HOME/venv3.9/bin:$HOME/venv3.10/bin:$HOME/venv3.11/bin"

# Install pytest
- sh: "python3.9 -m venv $HOME/pytest"
Expand All @@ -85,14 +85,6 @@ install:
# get testing env vars
- sh: "sudo apt install -y jq"

# 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"

# install Rust
- sh: "curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL https://sh.rustup.rs | sh -s -- --default-toolchain none -y > /dev/null 2>&1"
- sh: "source $HOME/.cargo/env"
Expand Down Expand Up @@ -194,6 +186,14 @@ for:
- 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
Expand All @@ -203,6 +203,14 @@ for:
- 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
Expand All @@ -212,6 +220,14 @@ for:
- 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
Expand All @@ -221,6 +237,14 @@ for:
- 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
Expand All @@ -230,6 +254,14 @@ for:
- configuration: OtherTerraformBuildIntegTesting

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_other_cases.py --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# Integ testing deploy
Expand Down Expand Up @@ -275,6 +307,14 @@ for:
- configuration: LocalIntegTesting

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 tests/integration/local --json-report --json-report-file=TEST_REPORT-integration-local.json"

# End-to-end testing
Expand Down
71 changes: 51 additions & 20 deletions appveyor-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ configuration:
- OtherTesting

environment:
PYTHON_HOME: "$HOME/venv3.8/bin"
PYTHON_VERSION: '3.8'
AWS_DEFAULT_REGION: us-east-1
SAM_CLI_DEV: 1
NODE_VERSION: "14.17.6"
Expand All @@ -30,17 +32,6 @@ environment:
APPVEYOR_CONSOLE_DISABLE_PTY: false
APPVEYOR_DETAILED_SHELL_LOGGING: true

matrix:

- PYTHON_HOME: "$HOME/venv3.7/bin"
PYTHON_VERSION: '3.7'

- PYTHON_HOME: "$HOME/venv3.8/bin"
PYTHON_VERSION: '3.8'

- PYTHON_HOME: "$HOME/venv3.11/bin"
PYTHON_VERSION: '3.11'

install:
# AppVeyor's apt-get cache might be outdated, and the package could potentially be 404.
- sh: "sudo apt-get update --allow-releaseinfo-change"
Expand Down Expand Up @@ -78,22 +69,14 @@ install:
- sh: "./aws_cli/bin/python -m pip install awscli"
- sh: "PATH=$(echo $PWD'/aws_cli/bin'):$PATH"

- sh: "PATH=$PATH:$HOME/venv3.7/bin:$HOME/venv3.8/bin:$HOME/venv3.9/bin:$HOME/venv3.10/bin"
- sh: "PATH=$PATH:$HOME/venv3.7/bin:$HOME/venv3.8/bin:$HOME/venv3.9/bin:$HOME/venv3.10/bin:$HOME/venv3.11/bin"

# update ca-certificates which causes failures with newest golang library
- sh: "sudo apt-get install --reinstall ca-certificates"

# get testing env vars
- sh: "sudo apt install -y jq"

# 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"

# install Rust
- sh: "curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL https://sh.rustup.rs | sh -s -- --default-toolchain none -y > /dev/null 2>&1"
- sh: "source $HOME/.cargo/env"
Expand Down Expand Up @@ -191,6 +174,14 @@ for:
- 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
Expand All @@ -200,6 +191,14 @@ for:
- 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
Expand All @@ -209,6 +208,14 @@ for:
- 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
Expand All @@ -218,6 +225,14 @@ for:
- 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
Expand All @@ -227,6 +242,14 @@ for:
- configuration: OtherTerraformBuildIntegTesting

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_other_cases.py --json-report --json-report-file=TEST_REPORT-integration-buildcmd.json"

# Integ testing deploy
Expand Down Expand Up @@ -272,6 +295,14 @@ for:
- configuration: LocalIntegTesting

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 tests/integration/local --json-report --json-report-file=TEST_REPORT-integration-local.json"

# End-to-end testing
Expand Down
30 changes: 25 additions & 5 deletions appveyor-windows-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,13 @@ install:

# Make sure the temp directory exists for Python to use.
- ps: "mkdir -Force C:\\tmp"
- 'set PATH=%PYTHON_HOME%;C:\Ruby27-x64\bin;%PATH%;C:\Python37-x64;C:\Python39-x64;C:\Python310-x64'
- 'set PATH=%PYTHON_HOME%;C:\Ruby27-x64\bin;%PATH%;C:\Python37-x64;C:\Python39-x64;C:\Python310-x64;C:\Python311-x64'
- "echo %PYTHON_HOME%"
- "echo %PATH%"
- "python --version"
- "docker info"
- "docker version"

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

# Upgrade setuptools, wheel and virtualenv
- "python -m pip install --upgrade setuptools wheel virtualenv"
# Install pip for the python versions which is used by the tests
Expand Down Expand Up @@ -213,6 +209,10 @@ for:
- 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
Expand All @@ -221,6 +221,10 @@ for:
- 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
Expand All @@ -229,6 +233,10 @@ for:
- 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
Expand All @@ -237,6 +245,10 @@ for:
- 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
Expand All @@ -245,6 +257,10 @@ for:
- configuration: OtherTerraformBuildIntegTesting

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

- 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 Expand Up @@ -285,6 +301,10 @@ for:
- configuration: LocalIntegTesting

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

- ps: "pytest -vv tests/integration/local --json-report --json-report-file=TEST_REPORT-integration-local.json"

# End-to-end testing
Expand Down
Loading

0 comments on commit b260034

Please sign in to comment.