Skip to content

correcting runtime versions in integ test - #8947

Merged
Vandita2020 merged 1 commit into
aws:developfrom
Vandita2020:integ
May 7, 2026
Merged

Vandita2020 merged 1 commit into
aws:developfrom
Vandita2020:integ

Conversation

@Vandita2020

Copy link
Copy Markdown
Contributor

Which issue(s) does this change fix?

NA

Why is this change necessary?

Fixes the integration test failure:
terraform-build
other-and-e2e
tier1-windows-build-2

How does it address the issue?

What side effects does this change have?

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.

@Vandita2020
Vandita2020 requested a review from a team as a code owner May 5, 2026 22:41
@vicheey

vicheey commented May 5, 2026

Copy link
Copy Markdown
Contributor

Is there an integration test running for these updated cases?

@roger-zhangg roger-zhangg reopened this May 5, 2026
@Vandita2020
Vandita2020 changed the base branch from develop to nightly-builds May 6, 2026 19:59
@Vandita2020
Vandita2020 changed the base branch from nightly-builds to develop May 6, 2026 21:12

@aws-sam-cli-bot aws-sam-cli-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Results

Reviewed: a40fb27..427bec6
Files: 14
Comments: 1


Comments on lines outside the diff:

[tests/integration/validate/test_validate_command.py:214] [GENERAL] nodejs20.x was removed from supported_runtimes, but it was not added to the test_lint_deprecated_runtimes parametrize list (currently: nodejs, python3.9, nodejs18.x, ruby3.2, dotnet6). If the reason for the removal is that cfn-lint now reports nodejs20.x as deprecated (the most likely cause of the test_lint_supported_runtimes failure this PR is fixing), then dropping it from the supported list without adding it to the deprecated list means the project loses all linter coverage for that runtime. Consider adding it to the deprecated cases so the deprecation path is actually exercised:

@parameterized.expand(
   [
       ("nodejs",),
       ("python3.9",),
       ("nodejs18.x",),
       ("nodejs20.x",),
       ("ruby3.2",),
       ("dotnet6",),
   ]
)
def test_lint_deprecated_runtimes(self, runtime):

This also addresses the unresolved question from the previous review about integration-test coverage for the updated runtime cases. If nodejs20.x is not yet fully deprecated by cfn-lint (only warning, etc.), please note the intent in the PR so the gap is explicit.

@Vandita2020

Copy link
Copy Markdown
Contributor Author

Integration tests: https://github.com/aws/aws-sam-cli/actions/runs/25461443031

@Vandita2020
Vandita2020 added this pull request to the merge queue May 7, 2026
Merged via the queue into aws:develop with commit 1aeab0a May 7, 2026
53 checks passed
roger-zhangg added a commit to madhavdonthula1/aws-sam-cli that referenced this pull request Aug 19, 2026
…ng a non-rerun-safe sync test (aws#9190)

Two failures from last night's integration runs (32094973517, 32122795247). The pytest 9.1
unblock landed cleanly -- sync-code passes, other-and-e2e went from 135 errors to 0 -- and
these are the unrelated leftovers.

1. test_lint_supported_runtimes (failed in both runs)

cfn-lint marks provided.al2 EOL as of 2026-07-31, so `sam validate --lint` now exits 1
while the test asserts 0:

  W2531 Runtime 'provided.al2' was deprecated on '2026-07-31'.

Moved it out of supported_runtimes and into test_lint_deprecated_runtimes, which derives
the expected code (W2531/E2531/E2533) from cfn-lint's LmbdRuntimeLifecycle.json by date and
so does not need touching again as the runtime moves through create-block and update-block.
Same treatment as ruby3.2 in aws#8883 and nodejs20.x in aws#8947, except those were deleted
rather than moved. Checked the rest of the list: only provided.al2 is flagged; java8.al2 is
still clean and is the likely next one.

2. TestSyncAdlCasesWithCodeParameter.test_sync_code_function_without_dependencies

Reruns cannot help this test and actively hide why it failed. It edits test data in place
(update_file writes over code/before/python_function_no_deps/app.py) and the class-scoped
fixture that deploys the stack does not re-run, so once attempt 1 has mutated the tree the
retries run against inconsistent state. That is what the reported error was: the function
came back "Unable to import module 'app': No module named 'numpy'", so
_get_lambda_response returned None (error payloads have no "body") and the failure surfaced
as `TypeError: the JSON object must be str, bytes or bytearray, not NoneType` -- three
wasted deploy cycles and none of the original cause.

@pytest.mark.flaky(reruns=0) makes it report the real first-attempt failure immediately.
Transient invoke flakes are still covered: _get_lambda_response retries internally.

Worth flagging separately: 26 update_file calls across test_sync_adl.py (6),
test_sync_code.py (2) and test_sync_watch.py (20) write into code/before, so the same
rerun-unsafety applies wherever one of those fails after mutating. Only the test that
actually failed is marked here; making them rerun-safe is a bigger change.

Testing: with SAM_CLI_DEV=1 (as CI sets), test_lint_supported_runtimes and all 7
test_lint_deprecated_runtimes cases pass -- 8 passed. Verified reruns=0 is honoured (1
attempt versus 4 for an unmarked test). tests/integration/{sync,validate} collect 153
tests. black and ruff clean.
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.

4 participants