Skip to content

Commit e736b65

Browse files
ijemmyflochaz
andauthored
feat(logger): add e2e tests for logger (#529)
* doc(all): Clarify selecting REGION for e2 tests * build(logger): add e2e tests The tests spin up actual infrastructure on AWS, invoke Lambda function, verify that the logs are printed correctly, and destroy the stack afterward. * chore(logger): remove unused code and dependencies * chore(logger): add note about flaky case that not some logs are missing * chore(logger): remove unused code * chore(logger): fix eslint formatting in e2e tests and return request id from function * chore(logger): fix typescript errors when running e2e tests * Update CONTRIBUTING.md Co-authored-by: Florian Chazal <[email protected]> * Make doc use the same request id as in doc + Remove unrelevant comment Co-authored-by: Florian Chazal <[email protected]>
1 parent 8180be1 commit e736b65

11 files changed

+11448
-6106
lines changed

Diff for: CONTRIBUTING.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ To run unit tests you can either use
182182

183183
**e2e tests**
184184

185+
**Set up**
186+
We create e2e testing infrastructure with CDK. If you have never used it before, please check its [Getting started guide](https://docs.aws.amazon.com/cdk/v1/guide/getting_started.html). You need to run `cdk bootstrap` in the account and region you are going to run e2e tests.
187+
185188
**Write**
186189

187190
As mentioned in the previous section, tests are split into groups thanks to [jest-runner-groups](https://www.npmjs.com/package/jest-runner-groups) and therefore each test needs to be tagged properly by adding the following comments in the header of your unit test file:
@@ -207,9 +210,10 @@ To run e2e tests you can either use
207210
Two important env variable can be used:
208211

209212
* `AWS_PROFILE` to use the right AWS credentials
213+
* `AWS_REGION` to select the region to deploy e2e tests infrastructure
210214
* `DISABLE_TEARDOWN` if you don't want your stack to be destroyed at the end of the test (useful in dev mode when iterating over your code).
211215

212-
Example: `DISABLE_TEARDOWN=true AWS_PROFILE=dev-account npx jest --group=e2e/metrics/decorator`
216+
Example: `DISABLE_TEARDOWN=true AWS_PROFILE=dev-account AWS_REGION=eu-west-1 npx jest --group=e2e/metrics/decorator`
213217

214218
**Automate**
215219

0 commit comments

Comments
 (0)