Skip to content

fix(tests): move publish templates off deprecated python3.9 - #9210

Merged
roger-zhangg merged 1 commit into
developfrom
fix-publish-python39-deprecation
Sep 1, 2026
Merged

fix(tests): move publish templates off deprecated python3.9#9210
roger-zhangg merged 1 commit into
developfrom
fix-publish-python39-deprecation

Conversation

@roger-zhangg

Copy link
Copy Markdown
Member

Which issue(s) does this change fix?

N/A — found in the 2026-08-31 nightly (run 33379671789).

Why is this change necessary?

All 8 tests/integration/publish/test_command_integ.py tests fail because the Serverless Application Repository now refuses the runtime the test templates declare:

botocore.errorfactory.BadRequestException: An error occurred (BadRequestException)
when calling the CreateApplication operation: The following runtimes are no longer
supported for creating AWS Lambda functions: [python3.9]

This is a real API rejection rather than a flake, so it will keep failing every night until the templates move to a supported runtime.

How does it address the issue?

Changes Runtime: python3.9 to python3.14 in the six tests/integration/testdata/publish/ templates. One line each; nothing else.

Scoped deliberately:

  • tests/integration/validate/test_validate_command.py keeps python3.9. That test asserts cfn-lint flags deprecated runtimes, so 3.9 is the point of it — it passed in the same run and must not be touched.
  • Other suites still use python3.9 in test data (start_api, invoke, buildcmd and others), but those run against local images rather than the control plane and all passed in this run — deploy, package, sync-code, sync-watch and cloud-based-tests were all green. So the rejection is currently specific to SAR CreateApplication, and I have not pre-emptively churned templates that are working.

What side effects does this change have?

None expected. python3.14 is already a supported runtime throughout SAM CLI (samcli/local/common/runtime_template.py, samcli/lib/utils/architecture.py, samcli/lib/build/workflow_config.py, samcli/local/docker/lambda_image.py).

Verified before committing:

  • The expected-output files these tests compare against (metadata_*.json) do not contain the runtime, and test_command_integ.py asserts no runtime string, so the change cannot shift an expected value.
  • All six templates still parse, with Resources.HelloWorldFunction.Properties.Runtime reading python3.14.
  • make pr passes (9401 unit tests, 94.09% coverage).

The publish tests themselves need AWS credentials, so they run in CI rather than locally.

Mandatory Checklist

PRs will only be reviewed after checklist is complete

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

SAR CreateApplication now rejects python3.9, failing all 8 publish integration
tests. Only the publish templates are changed; the python3.9 in the validate
deprecated-runtime test is deliberate.
@roger-zhangg
roger-zhangg requested a review from a team as a code owner August 31, 2026 22:24
@roger-zhangg

Copy link
Copy Markdown
Member Author

Triggered the integration test suite on this branch to confirm the publish tests now pass: https://github.com/aws/aws-sam-cli/actions/runs/33446845602 (workflow_dispatch, install_mode=code).

The relevant job is other-and-e2e, which is where tests/integration/publish/test_command_integ.py runs and where all 8 failures appeared in the nightly.

Note the init failures in that same job are expected to persist here — they are fixed separately in #9206, not by this PR.

On Python availability: python3.14 is installed for this suite (tests/setup-python-uv.sh 3.9 3.10 3.12 3.13 3.14 3.11, integration-tests.yml:150). It is not strictly required, since these templates reference already-packaged code (CodeUri: s3://<bucket-name>/main.py) and the runtime string is validated by SAR rather than executed locally, but it is present either way.

@roger-zhangg
roger-zhangg added this pull request to the merge queue Sep 1, 2026
Merged via the queue into develop with commit 7ca0a8b Sep 1, 2026
77 of 79 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants