Skip to content

test(maintenance): add ESM output to e2e test #2370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Apr 17, 2024
Merged

test(maintenance): add ESM output to e2e test #2370

merged 17 commits into from
Apr 17, 2024

Conversation

dreamorosi
Copy link
Contributor

@dreamorosi dreamorosi commented Apr 16, 2024

Description of your changes

This PR switches some of the integration tests to use the ESM builds of the Powertools for AWS Lambda utilities so that we can increase confidence in these builds.

To achieve this I made the following changes:

  • modified the TestNodejsFunction construct to use either CJS or ESM based on inputs
  • switched ~50% of the functions in the e2e to use ESM
  • added a new test case for the Lambda Layers test to include ESM (with corresponding refactor)*

While at it, I also enabled minification and some other small bundle optimizations for the functions in our e2e tests.

  • This is true, excluding Node.js 16 for which I maintained only the CJS tests for the Layer. This is due to this and I also added a sentence in the docs to call out this limitation for Node.js 16, Layer, and ESM.

Related issues, RFCs

Issue number: #2346

Checklist

  • My changes meet the tenets criteria
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my change is effective and works
  • The PR title follows the conventional commit semantics

Breaking change checklist

Is it a breaking change?: NO

  • I have documented the migration process
  • I have added, implemented necessary warnings (if it can live side by side)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@dreamorosi dreamorosi self-assigned this Apr 16, 2024
@dreamorosi dreamorosi requested a review from a team April 16, 2024 13:09
@dreamorosi dreamorosi requested a review from a team as a code owner April 16, 2024 13:09
@dreamorosi dreamorosi linked an issue Apr 16, 2024 that may be closed by this pull request
2 tasks
@boring-cyborg boring-cyborg bot added layers Items related to the Lambda Layers pipeline tests PRs that add or change tests labels Apr 16, 2024
@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Apr 16, 2024
@boring-cyborg boring-cyborg bot added the automation This item relates to automation label Apr 17, 2024
@dreamorosi dreamorosi marked this pull request as draft April 17, 2024 07:11
@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label Apr 17, 2024
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
6.3% Duplication on New Code

See analysis details on SonarCloud

@dreamorosi
Copy link
Contributor Author

This is a passing result for the e2e tests:
https://github.com/aws-powertools/powertools-lambda-typescript/actions/runs/8722852303

@dreamorosi dreamorosi marked this pull request as ready for review April 17, 2024 13:42
@am29d am29d merged commit 84a5ff8 into main Apr 17, 2024
@am29d am29d deleted the chore/esm_e2e_test branch April 17, 2024 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation This item relates to automation documentation Improvements or additions to documentation layers Items related to the Lambda Layers pipeline size/L PRs between 100-499 LOC tests PRs that add or change tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maintenance: add ESM builds to integration tests
2 participants