Skip to content

Commit 46fb2dc

Browse files
authored
feat(synthetics): allow root level canary scripts files for Puppeteer versions 11 and greater (#35426)
### Issue # (if applicable) Closes #<issue number here>. ### Reason for this change Support packaging structure changes for new runtimes based on NodeJS runtime Puppeteer framework ### Description of changes As part of the new Puppeteer based runtimes (`syn-nodesj-puppeteer-11.0` and greater), users can have the canary script files in the root directory and are not required to use the `nodejs/node_modules` sub-directory to include the canary scripts. This PR ensures that we do not throw validation exception when users have their canary script in the root directory. Current requirement for the folder structure for Puppeteer based runtimes `Canary/nodejs/node_modules/index.js` With the above changes, along with the above structure support, we also support `Canary/index.js` ### Describe any new or updated permissions being added No new permission have been added ### Description of how you validated changes Validated the changes by creating a sample canary with the changes in place and ensured that we are able to create canaries on runtime version `syn-nodejs-puppeteer-11.0` with the `index.js` files in the root directory as well as `index.js` file being present in the `nodejs/node_modules` subdirectory inside the root directory. Added corresponding unit tests and integration tests. ### 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 3aa186c commit 46fb2dc

File tree

20 files changed

+1851
-4
lines changed

20 files changed

+1851
-4
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const synthetics = require('Synthetics');
2+
3+
const handler = async () => {
4+
return await synthetics.executeStep('step1', async function () {
5+
// Test step for puppeteer 11.0+ root-level validation
6+
console.log('Testing puppeteer 11.0+ with root-level JS file');
7+
});
8+
};
9+
10+
exports.handler = handler;

packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary-runtime-validation.js.snapshot/SyntheticsCanaryRuntimeValidationDefaultTestDeployAssert9B35538B.assets.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary-runtime-validation.js.snapshot/SyntheticsCanaryRuntimeValidationDefaultTestDeployAssert9B35538B.template.json

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary-runtime-validation.js.snapshot/SyntheticsCanaryRuntimeValidationStack.assets.json

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)