-
Notifications
You must be signed in to change notification settings - Fork 153
chore(ci): move e2e utils into testing #1661
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
dreamorosi
merged 18 commits into
main
from
1660-maintenance-move-e2e-utilities-into-testing-package
Sep 1, 2023
Merged
chore(ci): move e2e utils into testing #1661
dreamorosi
merged 18 commits into
main
from
1660-maintenance-move-e2e-utilities-into-testing-package
Sep 1, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 tasks
abf2d43
to
e511b71
Compare
Kudos, SonarCloud Quality Gate passed!
|
Successful integration tests run: https://github.com/aws-powertools/powertools-lambda-typescript/actions/runs/6052552726 |
2 tasks
2 tasks
This was referenced Sep 3, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
dependencies
Changes that touch dependencies, e.g. Dependabot, etc.
layers
Items related to the Lambda Layers pipeline
size/XXL
PRs with 1K+ LOC, largely documentation related
tests
PRs that add or change tests
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of your changes
This PR introduces cross-cutting changes to the integration tests for all utilities in the project. The main goals of this PR are two:
In #1633 we have created an internal testing package that holds resources dedicated to deploy and run integration tests using CDK. Prior to this PR the package contained only the basic
TestStack
construct and a handful helper functions. Most of the actual logic used to add resources to a CDK stack was still scattered around the different packages of the workspace.This PR almost completely removes the usage of custom functions/abstractions to create CDK resources in favor of following patterns suggested by CDK like composition and inheritance.
For instance, before this PR multiple utilities were defining their version of an helper function that looked something like this:
This led to several different but similar implementations that created slightly different variations of the same type of resource.
With this PR the testing package offers a base CDK resource that extends the CDK L3 construct directly and that applies the same set of defaults across all tests:
Different utilities (Tracer, Metrics, etc.) can then use this base L3+ construct and extend it further to apply specific configurations that are unique to that test/utility:
In this way, in addition to having less code to maintain, we have the certainty that all the resources used during integration tests start from the same set of defaults.
The same pattern has been applied to DynamoDB tables and other resources that are used across different tests / utilities.
In addition to the benefits described above this, together with a handful new helper functions that allow to create unique resource names, also leads to more terse test setups.
The integration tests for this projects are run for different runtimes and utilities concurrently. This means that all resources from stacks to single AWS resources must have unique but identifiable names.
Another change brought by this PR is enforcing this constraint and making sure that all resources follow the same scheme:
<Utility Name>-<runtime>-<uuid{0, 5}>-<human readable suffix>
, i.e.Logger-E2E-node18-1dad3-AllFeatures-Decorator
.This is done with the introduction and rollout of a couple of helper functions that take in a prefix (the test name) and a suffix (the resource name) and generate the string by reading the test context.
Related issues, RFCs
Issue number: closes #1660
Checklist
Breaking change checklist
Is it a breaking change?: NO
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.