From 275d44e6b616efaf51c22c0b5f8d1d497f4249fa Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Mon, 31 Jul 2023 16:41:19 -0700 Subject: [PATCH 01/19] Add Windows config --- appveyor-windows-binary.yml | 307 ++++++++++++++++++++++++++++++++++++ 1 file changed, 307 insertions(+) create mode 100644 appveyor-windows-binary.yml diff --git a/appveyor-windows-binary.yml b/appveyor-windows-binary.yml new file mode 100644 index 0000000000..42aed38854 --- /dev/null +++ b/appveyor-windows-binary.yml @@ -0,0 +1,307 @@ +version: 1.0.{build} +image: Visual Studio 2022 +build: off + +clone_folder: C:\source + +configuration: + - BuildIntegTesting + - LocalZipTerraformBuildIntegTesting + - LocalZipTerraformBuildInContainerIntegTesting + - S3ZipTerraformBuildIntegTesting + - S3ZipTerraformBuildInContainerIntegTesting + - OtherTerraformBuildIntegTesting + - DeployIntegTesting + - PackageIntegTesting + - DeleteIntegTesting + - SyncIntegTesting + - LocalIntegTesting + - EndToEndTesting + # other Integration testing, Dev, regression and smoke testing + - OtherTesting + +environment: + AWS_DEFAULT_REGION: us-east-1 + SAM_CLI_DEV: 1 + CARGO_LAMBDA_VERSION: "v0.17.1" + + # Python uses $TMPDIR envvar to find root of tempdir + TMPDIR: "%TEMP%" + TMP: "%TEMP%" + + # MSI Installers only use Py3.8. It is sufficient to test with this version here. + PYTHON_HOME: "C:\\Python38-x64" + PYTHON_SCRIPTS: "C:\\Python38-x64\\Scripts" + PYTHON_EXE: "C:\\Python38-x64\\python.exe" + PYTHON_ARCH: "64" + HOME: 'C:\Users\appveyor' + HOMEDRIVE: "C:" + HOMEPATH: 'C:\Users\appveyor' + NOSE_PARAMETERIZED_NO_WARN: 1 + AWS_S3: "AWS_S3_TESTING" + AWS_ECR: "AWS_ECR_TESTING" + APPVEYOR_CONSOLE_DISABLE_PTY: true + +init: + # Uncomment this for RDP + # - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + - ps: gcim Win32_Processor | % { "$($_.NumberOfLogicalProcessors) logical CPUs" } + - ps: gcim Win32_OperatingSystem | % { "$([int]($_.TotalVisibleMemorySize/1mb)) Gb" } + - git config --global core.autocrlf false + - ps: New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force + - ps: git config --system core.longpaths true + +cache: + - C:\ProgramData\chocolatey\bin -> appveyor.yml + - C:\ProgramData\chocolatey\lib -> appveyor.yml + +install: + # setup make + - "choco install make" + # setup Java, Maven and Gradle + - "choco install gradle -y --force" + - 'set JAVA_HOME=C:\Program Files\Java\jdk17' + - 'set PATH=%JAVA_HOME%\bin;%PATH%' + - "javac -version" + - "java -version" + - "gradle -v" + - "mvn --version" + + # 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' + - "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 + - "C:\\Python37-x64\\python.exe -m pip install --upgrade pip" + - "C:\\Python39-x64\\python.exe -m pip install --upgrade pip" + - "C:\\Python310-x64\\python.exe -m pip install --upgrade pip" + + # Install AWS CLI Globally via pip3 + - "pip install awscli" + + # Switch to Docker Linux containers + - ps: Switch-DockerLinux + + # Check for git executable + - "git --version" + + # Get testing env vars + - ps: " + If (Test-Path env:BY_CANARY){ + python -m virtualenv venv_env_vars; + ./venv_env_vars/Scripts/pip install boto3; + $test_env_var = ./venv_env_vars/Scripts/python tests/get_testing_resources.py; + $test_env_var_json = ConvertFrom-Json $test_env_var; + + $env:CI_ACCESS_ROLE_AWS_ACCESS_KEY_ID = $env:AWS_ACCESS_KEY_ID; + $env:CI_ACCESS_ROLE_AWS_SECRET_ACCESS_KEY = $env:AWS_SECRET_ACCESS_KEY; + $env:CI_ACCESS_ROLE_AWS_SESSION_TOKEN = $env:AWS_SESSION_TOKEN; + + $env:AWS_ACCESS_KEY_ID = $test_env_var_json.accessKeyID; + $env:AWS_SECRET_ACCESS_KEY = $test_env_var_json.secretAccessKey; + $env:AWS_SESSION_TOKEN = $test_env_var_json.sessionToken; + $env:TASK_TOKEN = $test_env_var_json.taskToken; + $env:AWS_S3_TESTING = $test_env_var_json.TestBucketName; + $env:AWS_ECR_TESTING = $test_env_var_json.TestECRURI; + $env:AWS_KMS_KEY = $test_env_var_json.TestKMSKeyArn; + $env:AWS_SIGNING_PROFILE_NAME = $test_env_var_json.TestSigningProfileName; + $env:AWS_SIGNING_PROFILE_VERSION_ARN = $test_env_var_json.TestSigningProfileARN; + }" + + + # Create new virtual environment with chosen python version and activate it + - "python -m virtualenv venv" + - "venv\\Scripts\\activate" + - "python --version" + + # Install aws-sam-cli MSI binary + - ps: " + Write-Host "Starting installation for MSI" + Invoke-WebRequest https://github.com/aws/aws-sam-cli/releases/downloads/sam-cli-nightly/AWS_SAM_CLI_64_PY3.msi -OutFile $HOME\aws-sam-cli-installer.msi + $process = Start-Process C:\Windows\System32\msiexec.exe -ArgumentList "/i $HOME\aws-sam-cli-installer.msi /qn /norestart" -wait -PassThru + $process + Set-Alias -Name sam -Value 'C:\Program Files\Amazon\AWSSAMCLI_NIGHTLY\bin\sam-nightly.cmd' + sam --version + " + + # Install aws cli + - "pip install awscli" + + # Echo final Path + - "echo %PATH%" + + # use amazon-ecr-credential-helper + - choco install amazon-ecr-credential-helper + - ps: " + $docker_config = Get-Content $env:HOME/.docker/config.json -raw | ConvertFrom-Json; + $docker_config.credsStore = 'ecr-login'; + $docker_config | ConvertTo-Json | set-content $env:HOME/.docker/config.json; + " + - ps: "get-content $env:HOME/.docker/config.json" + + # claim some disk space before starting the tests + - "docker system prune -a -f" + # activate virtual environment + - "venv\\Scripts\\activate" + + + +# Final clean up no matter success or failure +on_finish: + # Upload test reports as artifacts + - ps: Get-ChildItem .\TEST_REPORT-*.json | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } + - ps: ' + If (Test-Path env:BY_CANARY){ + $env:AWS_ACCESS_KEY_ID = $env:TEST_REPORT_S3_BUCKET_ACCESS_KEY_ID; + $env:AWS_SECRET_ACCESS_KEY = $env:TEST_REPORT_S3_BUCKET_SECRET_ACCESS_KEY; + $env:AWS_SESSION_TOKEN = $env:TEST_REPORT_S3_BUCKET_SESSION_TOKEN; + aws s3 cp ".\" "s3://$env:TEST_REPORT_S3_BUCKET_NAME/appveyor/$env:APPVEYOR_PROJECT_SLUG/$env:APPVEYOR_BUILD_ID/$env:APPVEYOR_JOB_ID/" --recursive --exclude "*" --include "TEST_REPORT-*.json" --region us-west-2 + }' + + # notify success + - ps: " + If (Test-Path env:BY_CANARY){ + $env:AWS_ACCESS_KEY_ID = $env:CI_ACCESS_ROLE_AWS_ACCESS_KEY_ID; + $env:AWS_SECRET_ACCESS_KEY = $env:CI_ACCESS_ROLE_AWS_SECRET_ACCESS_KEY; + $env:AWS_SESSION_TOKEN = $env:CI_ACCESS_ROLE_AWS_SESSION_TOKEN; + aws stepfunctions send-task-success --task-token \"$env:TASK_TOKEN\" --task-output \"{}\" --region us-west-2; + }" + + +for: + #Integ testing build, regression + - matrix: + only: + - configuration: BuildIntegTesting + + build_script: + # install Rust in build_script to not override the default "install" actions + - appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe + - rustup-init.exe -y --default-host x86_64-pc-windows-msvc --default-toolchain stable + - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin + - set RUST_BACKTRACE=1 + - rustup toolchain install stable --profile minimal --no-self-update + - rustup default stable + - rustup target add x86_64-unknown-linux-gnu --toolchain stable + - rustup target add aarch64-unknown-linux-gnu --toolchain stable + - ps: "choco install zig" + - ps: Invoke-WebRequest -Uri https://github.com/cargo-lambda/cargo-lambda/releases/download/$env:CARGO_LAMBDA_VERSION/cargo-lambda-$env:CARGO_LAMBDA_VERSION.windows-x64.zip -OutFile C:\Users\appveyor\cargo-lambda.zip + - ps: Expand-Archive -DestinationPath C:\Users\appveyor\.cargo\bin C:\Users\appveyor\cargo-lambda.zip + - rustc -V + - cargo -V + - cargo lambda -V + + 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 + - matrix: + only: + - configuration: LocalZipTerraformBuildIntegTesting + + test_script: + - 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: + - 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: + - 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: + - 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 + + test_script: + - 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: + - configuration: PackageIntegTesting + + test_script: + - ps: "pytest -vv tests/integration/package -n 4 --reruns 4 --json-report --json-report-file=TEST_REPORT-integration-package.json" + + # Integ testing delete + - matrix: + only: + - configuration: DeleteIntegTesting + + test_script: + - ps: "pytest -vv tests/integration/delete -n 4 --reruns 4 --json-report --json-report-file=TEST_REPORT-integration-delete.json" + + # Integ testing sync + - matrix: + only: + - configuration: SyncIntegTesting + + test_script: + - ps: "pytest -vv tests/integration/sync -n 3 --reruns 3 --dist loadscope --json-report --json-report-file=TEST_REPORT-integration-sync.json" + + #Integ testing local + - matrix: + only: + - configuration: LocalIntegTesting + + test_script: + - ps: "pytest -vv tests/integration/local --json-report --json-report-file=TEST_REPORT-integration-local.json" + + # End-to-end testing + - matrix: + only: + - configuration: EndToEndTesting + + test_script: + - ps: "pytest -vv -n 4 --reruns 5 --dist loadscope tests/end_to_end --json-report --json-report-file=TEST_REPORT-end-to-end.json" + + #Other testing + - matrix: + only: + - configuration: OtherTesting + + test_script: + - ps: "pytest -vv -n 4 --reruns 4 --dist loadgroup tests/integration --ignore=tests/integration/buildcmd --ignore=tests/integration/delete --ignore=tests/integration/deploy --ignore=tests/integration/package --ignore=tests/integration/sync --ignore=tests/integration/local --json-report --json-report-file=TEST_REPORT-integration-others.json" + - ps: "pytest -vv tests/regression --json-report --json-report-file=TEST_REPORT-regression.json" +# Uncomment for RDP +# on_finish: +# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + From d0d68daffa2b8bd7f8cea29e1151d4a0f7e3bda6 Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Mon, 31 Jul 2023 16:48:51 -0700 Subject: [PATCH 02/19] Fix formatting --- appveyor-windows-binary.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/appveyor-windows-binary.yml b/appveyor-windows-binary.yml index 42aed38854..d3ffd2a00b 100644 --- a/appveyor-windows-binary.yml +++ b/appveyor-windows-binary.yml @@ -127,12 +127,12 @@ install: # Install aws-sam-cli MSI binary - ps: " - Write-Host "Starting installation for MSI" - Invoke-WebRequest https://github.com/aws/aws-sam-cli/releases/downloads/sam-cli-nightly/AWS_SAM_CLI_64_PY3.msi -OutFile $HOME\aws-sam-cli-installer.msi - $process = Start-Process C:\Windows\System32\msiexec.exe -ArgumentList "/i $HOME\aws-sam-cli-installer.msi /qn /norestart" -wait -PassThru - $process - Set-Alias -Name sam -Value 'C:\Program Files\Amazon\AWSSAMCLI_NIGHTLY\bin\sam-nightly.cmd' - sam --version + Write-Host "Starting installation for MSI" + Invoke-WebRequest https://github.com/aws/aws-sam-cli/releases/downloads/sam-cli-nightly/AWS_SAM_CLI_64_PY3.msi -OutFile $HOME\aws-sam-cli-installer.msi + $process = Start-Process C:\Windows\System32\msiexec.exe -ArgumentList "/i $HOME\aws-sam-cli-installer.msi /qn /norestart" -wait -PassThru + $process + Set-Alias -Name sam -Value 'C:\Program Files\Amazon\AWSSAMCLI_NIGHTLY\bin\sam-nightly.cmd' + sam --version " # Install aws cli From 0ae07bb4d564cc101661ab995e82be2a1f16ad64 Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Mon, 31 Jul 2023 16:55:22 -0700 Subject: [PATCH 03/19] Update config --- appveyor-windows-binary.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/appveyor-windows-binary.yml b/appveyor-windows-binary.yml index d3ffd2a00b..3038f99515 100644 --- a/appveyor-windows-binary.yml +++ b/appveyor-windows-binary.yml @@ -127,7 +127,6 @@ install: # Install aws-sam-cli MSI binary - ps: " - Write-Host "Starting installation for MSI" Invoke-WebRequest https://github.com/aws/aws-sam-cli/releases/downloads/sam-cli-nightly/AWS_SAM_CLI_64_PY3.msi -OutFile $HOME\aws-sam-cli-installer.msi $process = Start-Process C:\Windows\System32\msiexec.exe -ArgumentList "/i $HOME\aws-sam-cli-installer.msi /qn /norestart" -wait -PassThru $process From eeee79b08788357208abc7b0f2175b0439999baf Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Mon, 31 Jul 2023 17:00:44 -0700 Subject: [PATCH 04/19] test --- appveyor-windows-binary.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/appveyor-windows-binary.yml b/appveyor-windows-binary.yml index 3038f99515..5a3f0fc127 100644 --- a/appveyor-windows-binary.yml +++ b/appveyor-windows-binary.yml @@ -126,13 +126,13 @@ install: - "python --version" # Install aws-sam-cli MSI binary - - ps: " - Invoke-WebRequest https://github.com/aws/aws-sam-cli/releases/downloads/sam-cli-nightly/AWS_SAM_CLI_64_PY3.msi -OutFile $HOME\aws-sam-cli-installer.msi - $process = Start-Process C:\Windows\System32\msiexec.exe -ArgumentList "/i $HOME\aws-sam-cli-installer.msi /qn /norestart" -wait -PassThru - $process - Set-Alias -Name sam -Value 'C:\Program Files\Amazon\AWSSAMCLI_NIGHTLY\bin\sam-nightly.cmd' - sam --version - " +# - ps: " +# Invoke-WebRequest https://github.com/aws/aws-sam-cli/releases/downloads/sam-cli-nightly/AWS_SAM_CLI_64_PY3.msi -OutFile $HOME\aws-sam-cli-installer.msi +# $process = Start-Process C:\Windows\System32\msiexec.exe -ArgumentList "/i $HOME\aws-sam-cli-installer.msi /qn /norestart" -wait -PassThru +# $process +# Set-Alias -Name sam -Value 'C:\Program Files\Amazon\AWSSAMCLI_NIGHTLY\bin\sam-nightly.cmd' +# sam --version +# " # Install aws cli - "pip install awscli" From b378f798aed17b2b6381e8e78dadeff7b05bbf3d Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Mon, 31 Jul 2023 17:10:28 -0700 Subject: [PATCH 05/19] Update config --- appveyor-windows-binary.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/appveyor-windows-binary.yml b/appveyor-windows-binary.yml index 5a3f0fc127..3d131b6ea6 100644 --- a/appveyor-windows-binary.yml +++ b/appveyor-windows-binary.yml @@ -126,13 +126,15 @@ install: - "python --version" # Install aws-sam-cli MSI binary -# - ps: " -# Invoke-WebRequest https://github.com/aws/aws-sam-cli/releases/downloads/sam-cli-nightly/AWS_SAM_CLI_64_PY3.msi -OutFile $HOME\aws-sam-cli-installer.msi -# $process = Start-Process C:\Windows\System32\msiexec.exe -ArgumentList "/i $HOME\aws-sam-cli-installer.msi /qn /norestart" -wait -PassThru -# $process -# Set-Alias -Name sam -Value 'C:\Program Files\Amazon\AWSSAMCLI_NIGHTLY\bin\sam-nightly.cmd' -# sam --version -# " + - ps: " + Invoke-WebRequest https://github.com/aws/aws-sam-cli/releases/downloads/sam-cli-nightly/AWS_SAM_CLI_64_PY3.msi -OutFile $HOME\aws-sam-cli-installer.msi + $process = Start-Process C:\Windows\System32\msiexec.exe -ArgumentList "/i $HOME\aws-sam-cli-installer.msi /qn /norestart" -wait -PassThru + $process + Set-Alias -Name sam -Value 'C:\Program Files\Amazon\AWSSAMCLI_NIGHTLY\bin\sam-nightly.cmd' + sam --version + " + + - "pip install pytest" # Install aws cli - "pip install awscli" From 88a21e10b81ed1f66ff07d2a514f2d1e393a04c6 Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Mon, 31 Jul 2023 17:14:03 -0700 Subject: [PATCH 06/19] Update config --- appveyor-windows-binary.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appveyor-windows-binary.yml b/appveyor-windows-binary.yml index 3d131b6ea6..47ee0a57a9 100644 --- a/appveyor-windows-binary.yml +++ b/appveyor-windows-binary.yml @@ -127,12 +127,13 @@ install: # Install aws-sam-cli MSI binary - ps: " + If (Test-Path env:BY_CANARY){ Invoke-WebRequest https://github.com/aws/aws-sam-cli/releases/downloads/sam-cli-nightly/AWS_SAM_CLI_64_PY3.msi -OutFile $HOME\aws-sam-cli-installer.msi $process = Start-Process C:\Windows\System32\msiexec.exe -ArgumentList "/i $HOME\aws-sam-cli-installer.msi /qn /norestart" -wait -PassThru $process Set-Alias -Name sam -Value 'C:\Program Files\Amazon\AWSSAMCLI_NIGHTLY\bin\sam-nightly.cmd' sam --version - " + }" - "pip install pytest" From a5150f2f9cc4e962338782c8c26e1e7403191539 Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Mon, 31 Jul 2023 17:18:28 -0700 Subject: [PATCH 07/19] Update config --- appveyor-windows-binary.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/appveyor-windows-binary.yml b/appveyor-windows-binary.yml index 47ee0a57a9..a6583ae72f 100644 --- a/appveyor-windows-binary.yml +++ b/appveyor-windows-binary.yml @@ -127,13 +127,12 @@ install: # Install aws-sam-cli MSI binary - ps: " - If (Test-Path env:BY_CANARY){ Invoke-WebRequest https://github.com/aws/aws-sam-cli/releases/downloads/sam-cli-nightly/AWS_SAM_CLI_64_PY3.msi -OutFile $HOME\aws-sam-cli-installer.msi - $process = Start-Process C:\Windows\System32\msiexec.exe -ArgumentList "/i $HOME\aws-sam-cli-installer.msi /qn /norestart" -wait -PassThru + $process = Start-Process 'C:\Windows\System32\msiexec.exe' -ArgumentList '/i $HOME\aws-sam-cli-installer.msi /qn /norestart' -wait -PassThru $process Set-Alias -Name sam -Value 'C:\Program Files\Amazon\AWSSAMCLI_NIGHTLY\bin\sam-nightly.cmd' sam --version - }" + " - "pip install pytest" From 98f2cc88008de5891949a66266f6182c54a2d117 Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Mon, 31 Jul 2023 17:21:49 -0700 Subject: [PATCH 08/19] Update config --- appveyor-windows-binary.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor-windows-binary.yml b/appveyor-windows-binary.yml index a6583ae72f..bf217e3ec4 100644 --- a/appveyor-windows-binary.yml +++ b/appveyor-windows-binary.yml @@ -128,9 +128,9 @@ install: # Install aws-sam-cli MSI binary - ps: " Invoke-WebRequest https://github.com/aws/aws-sam-cli/releases/downloads/sam-cli-nightly/AWS_SAM_CLI_64_PY3.msi -OutFile $HOME\aws-sam-cli-installer.msi - $process = Start-Process 'C:\Windows\System32\msiexec.exe' -ArgumentList '/i $HOME\aws-sam-cli-installer.msi /qn /norestart' -wait -PassThru + $process = Start-Process 'C:\\Windows\\System32\\msiexec.exe' -ArgumentList '/i $HOME\aws-sam-cli-installer.msi /qn /norestart' -wait -PassThru $process - Set-Alias -Name sam -Value 'C:\Program Files\Amazon\AWSSAMCLI_NIGHTLY\bin\sam-nightly.cmd' + Set-Alias -Name sam -Value 'C:\\Program Files\\Amazon\\AWSSAMCLI_NIGHTLY\\bin\\sam-nightly.cmd' sam --version " From c75486739680e25da08f023fe0885b18fbd75807 Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Tue, 1 Aug 2023 08:45:24 -0700 Subject: [PATCH 09/19] Update config --- appveyor-windows-binary.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor-windows-binary.yml b/appveyor-windows-binary.yml index bf217e3ec4..c2132db576 100644 --- a/appveyor-windows-binary.yml +++ b/appveyor-windows-binary.yml @@ -127,7 +127,7 @@ install: # Install aws-sam-cli MSI binary - ps: " - Invoke-WebRequest https://github.com/aws/aws-sam-cli/releases/downloads/sam-cli-nightly/AWS_SAM_CLI_64_PY3.msi -OutFile $HOME\aws-sam-cli-installer.msi + Invoke-WebRequest https://github.com/aws/aws-sam-cli/releases/downloads/sam-cli-nightly/AWS_SAM_CLI_64_PY3.msi -OutFile aws-sam-cli-installer.msi $process = Start-Process 'C:\\Windows\\System32\\msiexec.exe' -ArgumentList '/i $HOME\aws-sam-cli-installer.msi /qn /norestart' -wait -PassThru $process Set-Alias -Name sam -Value 'C:\\Program Files\\Amazon\\AWSSAMCLI_NIGHTLY\\bin\\sam-nightly.cmd' From d854da79b5afb34824d0d24d3c144ede0042b613 Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Tue, 1 Aug 2023 09:14:03 -0700 Subject: [PATCH 10/19] Update config --- appveyor-windows-binary.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor-windows-binary.yml b/appveyor-windows-binary.yml index c2132db576..79375ec4e6 100644 --- a/appveyor-windows-binary.yml +++ b/appveyor-windows-binary.yml @@ -114,7 +114,7 @@ install: $env:TASK_TOKEN = $test_env_var_json.taskToken; $env:AWS_S3_TESTING = $test_env_var_json.TestBucketName; $env:AWS_ECR_TESTING = $test_env_var_json.TestECRURI; - $env:AWS_KMS_KEY = $test_env_var_json.TestKMSKeyArn; + $env:AWS_KMS_KEY = $test_env_var_json.TestKMSKeyArn;en $env:AWS_SIGNING_PROFILE_NAME = $test_env_var_json.TestSigningProfileName; $env:AWS_SIGNING_PROFILE_VERSION_ARN = $test_env_var_json.TestSigningProfileARN; }" @@ -127,7 +127,7 @@ install: # Install aws-sam-cli MSI binary - ps: " - Invoke-WebRequest https://github.com/aws/aws-sam-cli/releases/downloads/sam-cli-nightly/AWS_SAM_CLI_64_PY3.msi -OutFile aws-sam-cli-installer.msi + Invoke-WebRequest -Uri https://github.com/aws/aws-sam-cli/releases/downloads/sam-cli-nightly/AWS_SAM_CLI_64_PY3.msi -OutFile aws-sam-cli-installer.msi $process = Start-Process 'C:\\Windows\\System32\\msiexec.exe' -ArgumentList '/i $HOME\aws-sam-cli-installer.msi /qn /norestart' -wait -PassThru $process Set-Alias -Name sam -Value 'C:\\Program Files\\Amazon\\AWSSAMCLI_NIGHTLY\\bin\\sam-nightly.cmd' From e7413aec659ca4ad173ddf3755c7e7de14df7938 Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Wed, 2 Aug 2023 09:41:20 -0700 Subject: [PATCH 11/19] Add linux config --- appveyor-linux-binary.yml | 296 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 296 insertions(+) create mode 100644 appveyor-linux-binary.yml diff --git a/appveyor-linux-binary.yml b/appveyor-linux-binary.yml new file mode 100644 index 0000000000..46d09bf4db --- /dev/null +++ b/appveyor-linux-binary.yml @@ -0,0 +1,296 @@ +version: 1.0.{build} +image: + - Ubuntu2004 + +configuration: + - BuildIntegTesting + - LocalZipTerraformBuildIntegTesting + - LocalZipTerraformBuildInContainerIntegTesting + - S3ZipTerraformBuildIntegTesting + - S3ZipTerraformBuildInContainerIntegTesting + - OtherTerraformBuildIntegTesting + - DeployIntegTesting + - PackageIntegTesting + - DeleteIntegTesting + - SyncIntegTesting + - LocalIntegTesting + - EndToEndTesting + # other Integration testing, Dev, regression and smoke testing + - OtherTesting + +environment: + AWS_DEFAULT_REGION: us-east-1 + SAM_CLI_DEV: 1 + NODE_VERSION: "14.17.6" + AWS_S3: 'AWS_S3_TESTING' + AWS_ECR: 'AWS_ECR_TESTING' + CARGO_LAMBDA_VERSION: "v0.17.1" + PYTHON_ARCH: '64' + NOSE_PARAMETERIZED_NO_WARN: 1 + 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" + + - sh: "gvm use go1.19" + - sh: "echo $PATH" + - sh: "ls /usr/" + # install latest maven which is compatible with jdk17 + - sh: "sudo apt-get -y remove maven" + - sh: "wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.zip -P /tmp" + - sh: "sudo unzip -d /opt/mvn /tmp/apache-maven-*.zip" + - sh: "PATH=/opt/mvn/apache-maven-3.8.8/bin:$PATH" + - sh: "JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64" + - sh: "PATH=$JAVA_HOME/bin:$PATH" + - sh: "javac -version" + - sh: "java -version" + - sh: "mvn --version" + + - sh: "source ${HOME}/venv${PYTHON_VERSION}/bin/activate" + - sh: "rvm use 2.7.2" + - sh: "docker info" + - sh: "docker version" + - sh: "nvm install ${NODE_VERSION}" + - sh: "npm install npm@7.24.2 -g" + - sh: "npm -v" + + # Install latest gradle + - sh: "sudo apt-get -y remove gradle" + - sh: "wget https://services.gradle.org/distributions/gradle-7.3.1-bin.zip -P /tmp" + - sh: "sudo unzip -d /opt/gradle /tmp/gradle-*.zip" + - sh: "PATH=/opt/gradle/gradle-7.3.1/bin:$PATH" + + # Install AWS CLI + - sh: "virtualenv aws_cli" + - 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" + + # 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" + - sh: "rustup toolchain install stable --profile minimal --no-self-update" + - sh: "rustup default stable" + - sh: "rustup target add x86_64-unknown-linux-gnu --toolchain stable" + - sh: "rustup target add aarch64-unknown-linux-gnu --toolchain stable" + - sh: "pip install cargo-lambda==$CARGO_LAMBDA_VERSION" + - sh: "rustc -V" + - sh: "cargo -V" + - sh: "cargo lambda -V" + + - sh: "python3.9 -m venv .venv_env_vars" + - sh: ".venv_env_vars/bin/pip install boto3" + - sh: "test_env_var=$(.venv_env_vars/bin/python tests/get_testing_resources.py)" + - sh: ' + if [ $? -ne 0 ]; then + echo "get_testing_resources failed. Failed to acquire credentials or test resources."; + false; + fi + ' + + - sh: 'export CI_ACCESS_ROLE_AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID' + - sh: 'export CI_ACCESS_ROLE_AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY' + - sh: 'export CI_ACCESS_ROLE_AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN' + + - sh: 'export AWS_ACCESS_KEY_ID=$(echo "$test_env_var" | jq -j ".accessKeyID")' + - sh: 'export AWS_SECRET_ACCESS_KEY=$(echo "$test_env_var" | jq -j ".secretAccessKey")' + - sh: 'export AWS_SESSION_TOKEN=$(echo "$test_env_var" | jq -j ".sessionToken")' + - sh: 'export TASK_TOKEN=$(echo "$test_env_var" | jq -j ".taskToken")' + - sh: 'export AWS_S3_TESTING=$(echo "$test_env_var" | jq -j ".TestBucketName")' + - sh: 'export AWS_ECR_TESTING=$(echo "$test_env_var" | jq -j ".TestECRURI")' + - sh: 'export AWS_KMS_KEY=$(echo "$test_env_var" | jq -j ".TestKMSKeyArn")' + - sh: 'export AWS_SIGNING_PROFILE_NAME=$(echo "$test_env_var" | jq -j ".TestSigningProfileName")' + - sh: 'export AWS_SIGNING_PROFILE_VERSION_ARN=$(echo "$test_env_var" | jq -j ".TestSigningProfileARN")' + + # required for RIE with arm64 in linux + - sh: " + if [[ -n $BY_CANARY ]] && [[ -n $DOCKER_USER ]] && [[ -n $DOCKER_PASS ]]; + then echo Logging in Docker Hub; echo $DOCKER_PASS | docker login --username $DOCKER_USER --password-stdin registry-1.docker.io; + fi" + - sh: " + if [[ -n $BY_CANARY ]] && [[ -n $DOCKER_USER ]] && [[ -n $DOCKER_PASS ]]; + then echo Logging in Docker Hub; echo $DOCKER_PASS | docker login --username $DOCKER_USER --password-stdin; + fi" + - sh: "docker run --rm --privileged multiarch/qemu-user-static --reset -p yes" + + + # Runs only in Linux, logging Public ECR when running canary and cred is available + - sh: " + if [[ -n $BY_CANARY ]]; + then echo Logging in Public ECR; aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws; + fi" + + +build_script: + - curl -L https://github.com/aws/aws-sam-cli/releases/downloads/sam-cli-nightly/aws-sam-cli-linux-x86_64.zip -o aws-sam-cli-linux-x86_64.zip + - unzip aws-sam-cli-linux-x86_64.zip -d sam-installation + - ./sam-installation/install + - sam --version + +# Final clean up no matter success or failure +on_finish: + # Upload test reports as artifacts + - sh: find "$APPVEYOR_BUILD_FOLDER" -type f -name 'TEST_REPORT-*.json' -print0 | xargs -0 -I '{}' appveyor PushArtifact '{}' + - sh: > + AWS_ACCESS_KEY_ID=$TEST_REPORT_S3_BUCKET_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY=$TEST_REPORT_S3_BUCKET_SECRET_ACCESS_KEY + AWS_SESSION_TOKEN=$TEST_REPORT_S3_BUCKET_SESSION_TOKEN + aws s3 cp "$APPVEYOR_BUILD_FOLDER" "s3://$TEST_REPORT_S3_BUCKET_NAME/appveyor/$APPVEYOR_PROJECT_SLUG/$APPVEYOR_BUILD_ID/$APPVEYOR_JOB_ID/" --recursive --exclude "*" --include "TEST_REPORT-*.json" --region us-west-2 + + # notify task success + - sh: 'export AWS_ACCESS_KEY_ID=$CI_ACCESS_ROLE_AWS_ACCESS_KEY_ID' + - sh: 'export AWS_SECRET_ACCESS_KEY=$CI_ACCESS_ROLE_AWS_SECRET_ACCESS_KEY' + - sh: 'export AWS_SESSION_TOKEN=$CI_ACCESS_ROLE_AWS_SESSION_TOKEN' + + - sh: 'aws stepfunctions send-task-success --task-token "$TASK_TOKEN" --task-output "{}" --region us-west-2' + +for: + # Integ testing build + - + matrix: + only: + - configuration: BuildIntegTesting + + test_script: + - sh: "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" + + # Set JAVA_HOME to java11 + - 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 + - + matrix: + only: + - configuration: LocalZipTerraformBuildIntegTesting + + test_script: + - 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: + - 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: + - 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: + - 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 + + test_script: + - 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 + - + matrix: + only: + - configuration: DeployIntegTesting + + test_script: + - sh: "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: + - configuration: PackageIntegTesting + + test_script: + - sh: "pytest -vv tests/integration/package -n 4 --reruns 4 --json-report --json-report-file=TEST_REPORT-integration-package.json" + + # Integ testing delete + - + matrix: + only: + - configuration: DeleteIntegTesting + + test_script: + - sh: "pytest -vv tests/integration/delete -n 4 --reruns 4 --json-report --json-report-file=TEST_REPORT-integration-delete.json" + + # Integ testing sync + - + matrix: + only: + - configuration: SyncIntegTesting + + test_script: + - sh: "pytest -vv tests/integration/sync -n 3 --reruns 3 --dist loadscope --json-report --json-report-file=TEST_REPORT-integration-sync.json" + + # Integ testing local + - + matrix: + only: + - configuration: LocalIntegTesting + + test_script: + - sh: "pytest -vv tests/integration/local --json-report --json-report-file=TEST_REPORT-integration-local.json" + + # End-to-end testing + - + matrix: + only: + - configuration: EndToEndTesting + + test_script: + - sh: "pytest -vv -n 4 --reruns 5 --dist loadscope tests/end_to_end --json-report --json-report-file=TEST_REPORT-end-to-end.json" + + # Other testing + - + matrix: + only: + - configuration: OtherTesting + + test_script: + - sh: "pytest -vv -n 4 --reruns 4 --dist loadgroup tests/integration --ignore=tests/integration/buildcmd --ignore=tests/integration/delete --ignore=tests/integration/deploy --ignore=tests/integration/package --ignore=tests/integration/sync --ignore=tests/integration/local --json-report --json-report-file=TEST_REPORT-integration-others.json" + - sh: "pytest -vv tests/regression --json-report --json-report-file=TEST_REPORT-regression.json" From 78fe5a2f12badf780b396a74d345b513750890c6 Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Wed, 2 Aug 2023 11:39:11 -0700 Subject: [PATCH 12/19] Update install links --- appveyor-linux-binary.yml | 9 +-------- appveyor-windows-binary.yml | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/appveyor-linux-binary.yml b/appveyor-linux-binary.yml index 46d09bf4db..05dccfed14 100644 --- a/appveyor-linux-binary.yml +++ b/appveyor-linux-binary.yml @@ -31,13 +31,6 @@ environment: 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' @@ -150,7 +143,7 @@ install: build_script: - - curl -L https://github.com/aws/aws-sam-cli/releases/downloads/sam-cli-nightly/aws-sam-cli-linux-x86_64.zip -o aws-sam-cli-linux-x86_64.zip + - curl -L https://github.com/aws/aws-sam-cli/releases/download/sam-cli-nightly/aws-sam-cli-linux-x86_64.zip -o aws-sam-cli-linux-x86_64.zip - unzip aws-sam-cli-linux-x86_64.zip -d sam-installation - ./sam-installation/install - sam --version diff --git a/appveyor-windows-binary.yml b/appveyor-windows-binary.yml index 79375ec4e6..ffd0c59519 100644 --- a/appveyor-windows-binary.yml +++ b/appveyor-windows-binary.yml @@ -127,7 +127,7 @@ install: # Install aws-sam-cli MSI binary - ps: " - Invoke-WebRequest -Uri https://github.com/aws/aws-sam-cli/releases/downloads/sam-cli-nightly/AWS_SAM_CLI_64_PY3.msi -OutFile aws-sam-cli-installer.msi + Invoke-WebRequest -Uri https://github.com/aws/aws-sam-cli/releases/download/sam-cli-nightly/AWS_SAM_CLI_64_PY3.msi -OutFile aws-sam-cli-installer.msi $process = Start-Process 'C:\\Windows\\System32\\msiexec.exe' -ArgumentList '/i $HOME\aws-sam-cli-installer.msi /qn /norestart' -wait -PassThru $process Set-Alias -Name sam -Value 'C:\\Program Files\\Amazon\\AWSSAMCLI_NIGHTLY\\bin\\sam-nightly.cmd' From 44d4bfa9649866b570a3a1daf1b6b64868992232 Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Wed, 2 Aug 2023 13:59:00 -0700 Subject: [PATCH 13/19] Update linux config --- appveyor-linux-binary.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor-linux-binary.yml b/appveyor-linux-binary.yml index 05dccfed14..f2ad9b76b3 100644 --- a/appveyor-linux-binary.yml +++ b/appveyor-linux-binary.yml @@ -20,7 +20,6 @@ configuration: environment: AWS_DEFAULT_REGION: us-east-1 - SAM_CLI_DEV: 1 NODE_VERSION: "14.17.6" AWS_S3: 'AWS_S3_TESTING' AWS_ECR: 'AWS_ECR_TESTING' @@ -145,8 +144,9 @@ install: build_script: - curl -L https://github.com/aws/aws-sam-cli/releases/download/sam-cli-nightly/aws-sam-cli-linux-x86_64.zip -o aws-sam-cli-linux-x86_64.zip - unzip aws-sam-cli-linux-x86_64.zip -d sam-installation - - ./sam-installation/install - - sam --version + - sudo ./sam-installation/install + - sam-nightly --version + - alias sam='sam-nightly' # Final clean up no matter success or failure on_finish: From b22459d406422604e9970683583bc3ce9f94f6c9 Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Wed, 2 Aug 2023 14:21:08 -0700 Subject: [PATCH 14/19] Update linux config --- appveyor-linux-binary.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/appveyor-linux-binary.yml b/appveyor-linux-binary.yml index f2ad9b76b3..1deca2768a 100644 --- a/appveyor-linux-binary.yml +++ b/appveyor-linux-binary.yml @@ -70,6 +70,11 @@ install: - sh: "./aws_cli/bin/python -m pip install awscli" - sh: "PATH=$(echo $PWD'/aws_cli/bin'):$PATH" + # Install pytest + - sh: "virtualenv pytest" + - sh: "./pytest/bin/python -m pip install pytest" + - sh: "PATH=$(echo $PWD'/pytest/bin'):$PATH" + - sh: "PATH=$PATH:$HOME/venv3.7/bin:$HOME/venv3.8/bin:$HOME/venv3.9/bin:$HOME/venv3.10/bin" # update ca-certificates which causes failures with newest golang library @@ -147,6 +152,7 @@ build_script: - sudo ./sam-installation/install - sam-nightly --version - alias sam='sam-nightly' + - sam --version # Final clean up no matter success or failure on_finish: From 1ba36ac1ed84af8a4cef8d7991bb26a7b996c7e8 Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Wed, 2 Aug 2023 15:41:58 -0700 Subject: [PATCH 15/19] Update linux config --- appveyor-linux-binary.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor-linux-binary.yml b/appveyor-linux-binary.yml index 1deca2768a..74af3486df 100644 --- a/appveyor-linux-binary.yml +++ b/appveyor-linux-binary.yml @@ -151,6 +151,7 @@ build_script: - unzip aws-sam-cli-linux-x86_64.zip -d sam-installation - sudo ./sam-installation/install - sam-nightly --version + - shopt -s expand_aliases - alias sam='sam-nightly' - sam --version From 54972abe7eec96da527d42ba9839571e01d55f52 Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Wed, 2 Aug 2023 15:53:30 -0700 Subject: [PATCH 16/19] Update linux config --- appveyor-linux-binary.yml | 3 --- tests/testing_utils.py | 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/appveyor-linux-binary.yml b/appveyor-linux-binary.yml index 74af3486df..c7f9c7b8b9 100644 --- a/appveyor-linux-binary.yml +++ b/appveyor-linux-binary.yml @@ -151,9 +151,6 @@ build_script: - unzip aws-sam-cli-linux-x86_64.zip -d sam-installation - sudo ./sam-installation/install - sam-nightly --version - - shopt -s expand_aliases - - alias sam='sam-nightly' - - sam --version # Final clean up no matter success or failure on_finish: diff --git a/tests/testing_utils.py b/tests/testing_utils.py index a52898f90b..25681c5b33 100644 --- a/tests/testing_utils.py +++ b/tests/testing_utils.py @@ -44,7 +44,11 @@ def get_sam_command(): - return "samdev" if os.getenv("SAM_CLI_DEV") else "sam" + if os.getenv("SAM_CLI_NIGHTLY"): + return "sam-nightly" + if os.getenv("SAM_CLI_DEV"): + return "samdev" + return "sam" def method_to_stack_name(method_name): From 66a85e6b2cba296c05da9ea037457075e267f82f Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Wed, 2 Aug 2023 16:11:38 -0700 Subject: [PATCH 17/19] Update linux config --- appveyor-linux-binary.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/appveyor-linux-binary.yml b/appveyor-linux-binary.yml index c7f9c7b8b9..e9ce1ab584 100644 --- a/appveyor-linux-binary.yml +++ b/appveyor-linux-binary.yml @@ -71,11 +71,10 @@ install: - sh: "PATH=$(echo $PWD'/aws_cli/bin'):$PATH" # Install pytest - - sh: "virtualenv pytest" - - sh: "./pytest/bin/python -m pip install pytest" - - sh: "PATH=$(echo $PWD'/pytest/bin'):$PATH" + - sh: "$HOME/venv3.11/bin/python -m pip install pytest" - - 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" + - sh: "pytest --version" # update ca-certificates which causes failures with newest golang library - sh: "sudo apt-get install --reinstall ca-certificates" From fad6c46c0081e2c0e2b7d46ca1e3fc07f7845085 Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Wed, 2 Aug 2023 16:20:29 -0700 Subject: [PATCH 18/19] Update linux config --- appveyor-linux-binary.yml | 6 ++++-- tests/testing_utils.py | 6 +----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/appveyor-linux-binary.yml b/appveyor-linux-binary.yml index e9ce1ab584..85bee8aab5 100644 --- a/appveyor-linux-binary.yml +++ b/appveyor-linux-binary.yml @@ -71,10 +71,10 @@ install: - sh: "PATH=$(echo $PWD'/aws_cli/bin'):$PATH" # Install pytest - - sh: "$HOME/venv3.11/bin/python -m pip install pytest" + - sh: "sudo apt-get install python3-pytest -y" + - sh: "pytest --version" - sh: "PATH=$PATH:$HOME/venv3.7/bin:$HOME/venv3.8/bin:$HOME/venv3.9/bin:$HOME/venv3.10/bin:$HOME/venv3.11/bin" - - sh: "pytest --version" # update ca-certificates which causes failures with newest golang library - sh: "sudo apt-get install --reinstall ca-certificates" @@ -150,6 +150,8 @@ build_script: - unzip aws-sam-cli-linux-x86_64.zip -d sam-installation - sudo ./sam-installation/install - sam-nightly --version + - mv /usr/local/bin/sam-nightly /usr/local/bin/sam + - sam --version # Final clean up no matter success or failure on_finish: diff --git a/tests/testing_utils.py b/tests/testing_utils.py index 25681c5b33..a52898f90b 100644 --- a/tests/testing_utils.py +++ b/tests/testing_utils.py @@ -44,11 +44,7 @@ def get_sam_command(): - if os.getenv("SAM_CLI_NIGHTLY"): - return "sam-nightly" - if os.getenv("SAM_CLI_DEV"): - return "samdev" - return "sam" + return "samdev" if os.getenv("SAM_CLI_DEV") else "sam" def method_to_stack_name(method_name): From 748c100da2f6f11c49843b14e082a209806a8fdf Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Wed, 2 Aug 2023 16:27:36 -0700 Subject: [PATCH 19/19] Update linux config --- appveyor-linux-binary.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor-linux-binary.yml b/appveyor-linux-binary.yml index 85bee8aab5..7e587920e1 100644 --- a/appveyor-linux-binary.yml +++ b/appveyor-linux-binary.yml @@ -71,10 +71,10 @@ install: - sh: "PATH=$(echo $PWD'/aws_cli/bin'):$PATH" # Install pytest - - sh: "sudo apt-get install python3-pytest -y" + - sh: "pip3 install pytest" - sh: "pytest --version" - - sh: "PATH=$PATH:$HOME/venv3.7/bin:$HOME/venv3.8/bin:$HOME/venv3.9/bin:$HOME/venv3.10/bin:$HOME/venv3.11/bin" + - sh: "PATH=$PATH:$HOME/venv3.7/bin:$HOME/venv3.8/bin:$HOME/venv3.9/bin:$HOME/venv3.10/bin" # update ca-certificates which causes failures with newest golang library - sh: "sudo apt-get install --reinstall ca-certificates"