Skip to content

Commit 0153da4

Browse files
authored
chore(tools): add a tool to update lambda integration test cases to test runtime build images (#32267)
### Reason for this change This change to auto update the integration test cases for Lambda functions to make sure that SAM Build images we use to build functions are available. ### Description of changes - Add a tool to check Lambda function runtimes, and update Python, NodeJs, and Go lambda function test cases to test new runtimes. - Add a Github action to run this tool to auto update the Lambda functions test cases to make sure it will be updated even if contributors missed to execute it. - ### Checklist - [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent c77536f commit 0153da4

File tree

50 files changed

+78145
-15294
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+78145
-15294
lines changed

Diff for: .github/workflows/lambda-runtime-tests.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Lambda Runtime Tests Update
2+
on:
3+
pull_request:
4+
paths:
5+
- 'packages/aws-cdk-lib/aws-lambda/lib/runtime.ts'
6+
7+
jobs:
8+
update-lambda-tests:
9+
if: github.repository == 'aws/aws-cdk'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
ref: ${{ github.event.pull_request.head.ref }}
15+
16+
- name: Set up Node
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: "*"
20+
env:
21+
NODE_OPTIONS: "--max-old-space-size=8196 --experimental-worker ${NODE_OPTIONS:-}"
22+
23+
- name: Install dependencies
24+
run: yarn install --frozen-lockfile && cd tools/@aws-cdk/lambda-integration-test-updater && yarn build+test
25+
26+
- name: Update Lambda Runtime Tests
27+
run: |
28+
cd tools/@aws-cdk/lambda-integration-test-updater
29+
./bin/update-lambda-runtimestes-integ-testing
30+
31+
- name: Check for changes
32+
id: git-check
33+
run: |
34+
if [[ -n "$(git status --porcelain)" ]]; then
35+
echo "changes=true" >> $GITHUB_OUTPUT
36+
else
37+
echo "changes=false" >> $GITHUB_OUTPUT
38+
fi
39+
40+
- name: Commit & Push changes
41+
if: steps.git-check.outputs.changes == 'true'
42+
run: |
43+
git config --global user.name 'aws-cdk-automation'
44+
git config --global user.email '[email protected]'
45+
git add .
46+
git commit -m "chore: update lambda runtime integration tests"
47+
git push origin ${{ github.event.pull_request.head.ref }}

Diff for: lerna.json

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"tools/@aws-cdk/spec2cdk",
2020
"tools/@aws-cdk/yarn-cling",
2121
"tools/@aws-cdk/lazify",
22+
"tools/@aws-cdk/lambda-integration-test-updater",
2223
"scripts/@aws-cdk/script-tests"
2324
],
2425
"rejectCycles": true,

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
"tools/@aws-cdk/spec2cdk",
8888
"tools/@aws-cdk/yarn-cling",
8989
"tools/@aws-cdk/lazify",
90+
"tools/@aws-cdk/lambda-integration-test-updater",
9091
"scripts/@aws-cdk/script-tests"
9192
],
9293
"nohoist": [

Diff for: packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.nodejs.build.images.js.snapshot/LambdaNodeJsLatestIntegDefaultTestDeployAssertD40B5C28.assets.json

+32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)