Skip to content

Commit

Permalink
Merge pull request #5318 from aws/develop
Browse files Browse the repository at this point in the history
Merge develop to master
  • Loading branch information
mndeveci committed Jun 9, 2023
2 parents 6a5ef9f + 60f1882 commit 6ea5d5e
Show file tree
Hide file tree
Showing 57 changed files with 387 additions and 227 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/automated-updates-to-sam-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ jobs:
run: |
cd aws-sam-cli
git push --force origin update_app_templates_hash
gh pr list --repo aws/aws-sam-cli --head update_app_templates_hash --json id --jq length | grep 1 && exit 0 # exit if there is existing pr
gh pr list --repo aws/aws-sam-cli --head update_app_templates_hash --json id --jq length | grep 1 && \
gh pr close update_app_templates_hash --repo aws/aws-sam-cli && \
gh pr reopen update_app_templates_hash --repo aws/aws-sam-cli && \
exit 0 # if there is exisitng pr, close/reopen to re-run checks, then exit
gh pr create --base develop --head update_app_templates_hash --title "feat: update SAM CLI with latest App Templates commit hash" --body "This PR & commit is automatically created from App Templates repo to update the SAM CLI with latest hash of the App Templates." --label "pr/internal"
updateSAMTranslator:
Expand All @@ -65,13 +68,13 @@ jobs:
path: serverless-application-model
ref: main
fetch-depth: 0

- name: Checkout SAM CLI
uses: actions/checkout@v3
with:
repository: aws/aws-sam-cli
path: aws-sam-cli

- uses: actions/setup-python@v4 # used for make update-reproducible-reqs below
with:
python-version: |
Expand Down Expand Up @@ -105,7 +108,10 @@ jobs:
run: |
cd aws-sam-cli
git push --force origin update_sam_transform_version
gh pr list --repo aws/aws-sam-cli --head update_sam_transform_version --json id --jq length | grep 1 && exit 0 # exit if there is existing pr
gh pr list --repo aws/aws-sam-cli --head update_sam_transform_version --json id --jq length | grep 1 && \
gh pr close update_sam_transform_version --repo aws/aws-sam-cli && \
gh pr reopen update_sam_transform_version --repo aws/aws-sam-cli && \
exit 0 # if there is exisitng pr, close/reopen to re-run checks, then exit
gh pr create --base develop --head update_sam_transform_version --fill --label "pr/internal"
updateAWSLambdaBuilders:
Expand Down Expand Up @@ -161,5 +167,8 @@ jobs:
run: |
cd aws-sam-cli
git push --force origin update_lambda_builders_version
gh pr list --repo aws/aws-sam-cli --head update_lambda_builders_version --json id --jq length | grep 1 && exit 0 # exit if there is existing pr
gh pr list --repo aws/aws-sam-cli --head update_lambda_builders_version --json id --jq length | grep 1 && \
gh pr close update_lambda_builders_version --repo aws/aws-sam-cli && \
gh pr reopen update_lambda_builders_version --repo aws/aws-sam-cli && \
exit 0 # if there is exisitng pr, close/reopen to re-run checks, then exit
gh pr create --base develop --head update_lambda_builders_version --fill --label "pr/internal"
49 changes: 47 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ jobs:
- make-pr
- integration-tests
- smoke-and-functional-tests
- docker-disabled
steps:
- name: report-failure
if : |
needs.make-pr.result != 'success' ||
needs.integration-tests.result != 'success' ||
needs.smoke-and-functional-tests.result != 'success'
needs.smoke-and-functional-tests.result != 'success' ||
needs.docker-disabled.result != 'success'
run: exit 1
- name: report-success
run: exit 0
Expand All @@ -45,13 +47,14 @@ jobs:
fail-fast: false
matrix:
os:
# TODO: Add macos-latest; fails currently, see e.g. https://github.com/aws/aws-sam-cli/actions/runs/3596883449/jobs/6058055981
- macos-latest
- ubuntu-latest
- windows-latest
python:
- "3.7"
- "3.8"
- "3.9"
- "3.11"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand Down Expand Up @@ -112,6 +115,7 @@ jobs:
3.8
3.9
3.10
3.11
${{ matrix.python }}
- uses: actions/setup-go@v4
with:
Expand Down Expand Up @@ -178,6 +182,7 @@ jobs:
- "3.7"
- "3.8"
- "3.9"
- "3.11"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand All @@ -187,3 +192,43 @@ jobs:
run: make init
- name: Run functional & smoke tests
run: pytest -vv -n 4 tests/functional tests/smoke

docker-disabled:
name: Docker-disabled Tests / ${{ matrix.os }}
if: github.repository_owner == 'aws'
runs-on: ${{ matrix.os }}
env:
SAM_CLI_DEV: "1"
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
# These are the versions of Python that correspond to the supported Lambda runtimes
python-version: |
3.10
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
- name: Stop Docker Windows
if: ${{ matrix.os == 'windows-latest' }}
shell: pwsh
run: stop-service docker
- name: Check Docker not Running
run: docker info
id: run-docker-info
continue-on-error: true
- name: Report failure
if: steps.run-docker-info.outcome == 'success'
run: exit 1
- name: Run tests without Docker
run: pytest -vv tests/integration/buildcmd/test_build_cmd.py -k TestBuildCommand_PythonFunctions_WithoutDocker
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ lint:
# Linter performs static analysis to catch latent bugs
ruff samcli
# mypy performs type check
mypy --no-incremental setup.py samcli tests
mypy --exclude /testdata/ --exclude /init/templates/ --no-incremental setup.py samcli tests

# Command to run everytime you make changes to verify everything works
dev: lint test
Expand Down
53 changes: 4 additions & 49 deletions appveyor-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ install:

- sh: "source ${HOME}/venv${PYTHON_VERSION}/bin/activate"
- sh: "rvm use 2.7.2"
- sh: "docker --version"
- sh: "docker info"
- sh: "docker version"
- sh: "nvm install ${NODE_VERSION}"
- sh: "npm install npm@7.24.2 -g"
- sh: "npm -v"
Expand Down Expand Up @@ -149,7 +150,8 @@ install:


build_script:
- "python -c \"import sys; print(sys.executable)\""
- "python -c \"import sys; print(sys.executable)\""
- "make init"

# Final clean up no matter success or failure
on_finish:
Expand All @@ -176,10 +178,6 @@ for:
- configuration: BuildIntegTesting

test_script:
# Pre-dev Tests
- "pip install -e \".[pre-dev]\""

- "pip install -e \".[dev]\""
- 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
Expand All @@ -193,10 +191,6 @@ for:
- configuration: LocalZipTerraformBuildIntegTesting

test_script:
# Pre-dev Tests
- "pip install -e \".[pre-dev]\""

- "pip install -e \".[dev]\""
- 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 @@ -206,10 +200,6 @@ for:
- configuration: LocalZipTerraformBuildInContainerIntegTesting

test_script:
# Pre-dev Tests
- "pip install -e \".[pre-dev]\""

- "pip install -e \".[dev]\""
- 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 @@ -219,10 +209,6 @@ for:
- configuration: S3ZipTerraformBuildIntegTesting

test_script:
# Pre-dev Tests
- "pip install -e \".[pre-dev]\""

- "pip install -e \".[dev]\""
- 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 @@ -232,10 +218,6 @@ for:
- configuration: S3ZipTerraformBuildInContainerIntegTesting

test_script:
# Pre-dev Tests
- "pip install -e \".[pre-dev]\""

- "pip install -e \".[dev]\""
- 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 @@ -245,10 +227,6 @@ for:
- configuration: OtherTerraformBuildIntegTesting

test_script:
# Pre-dev Tests
- "pip install -e \".[pre-dev]\""

- "pip install -e \".[dev]\""
- 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 All @@ -258,7 +236,6 @@ for:
- configuration: DeployIntegTesting

test_script:
- "pip install -e \".[dev]\""
- 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
Expand All @@ -268,7 +245,6 @@ for:
- configuration: PackageIntegTesting

test_script:
- "pip install -e \".[dev]\""
- sh: "pytest -vv tests/integration/package -n 4 --reruns 4 --json-report --json-report-file=TEST_REPORT-integration-package.json"

# Integ testing delete
Expand All @@ -278,7 +254,6 @@ for:
- configuration: DeleteIntegTesting

test_script:
- "pip install -e \".[dev]\""
- sh: "pytest -vv tests/integration/delete -n 4 --reruns 4 --json-report --json-report-file=TEST_REPORT-integration-delete.json"

# Integ testing sync
Expand All @@ -288,7 +263,6 @@ for:
- configuration: SyncIntegTesting

test_script:
- "pip install -e \".[dev]\""
- 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
Expand All @@ -298,11 +272,6 @@ for:
- configuration: LocalIntegTesting

test_script:
# Pre-dev Tests
- "pip install -e \".[pre-dev]\""
- "ruff samcli"

- "pip install -e \".[dev]\""
- sh: "pytest -vv tests/integration/local --json-report --json-report-file=TEST_REPORT-integration-local.json"

# End-to-end testing
Expand All @@ -312,7 +281,6 @@ for:
- configuration: EndToEndTesting

test_script:
- "pip install -e \".[dev]\""
- 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
Expand All @@ -322,18 +290,5 @@ for:
- configuration: OtherTesting

test_script:
# Pre-dev Tests
- "pip install -e \".[pre-dev]\""
- "ruff samcli"

# Dev Tests
- "pip install -e \".[dev]\""
- "pytest --cov samcli --cov-report term-missing --cov-fail-under 94 tests/unit --json-report --json-report-file=TEST_REPORT-unit.json"
- "ruff samcli"
- "mypy setup.py samcli tests"
- "pytest -n 4 tests/functional --json-report --json-report-file=TEST_REPORT-functional.json"

- 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"
- sh: "black --check setup.py tests samcli"
- sh: "pytest -n 4 -vv tests/smoke --json-report --json-report-file=TEST_REPORT-smoke.json"
Loading

0 comments on commit 6ea5d5e

Please sign in to comment.