-
Notifications
You must be signed in to change notification settings - Fork 35
End-to-end testing using SAM CLI and locally run Lambdas #104
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
Conversation
Also added an env variable to toggle output, and modified the test flow to make sure that the right permissions are always set for the java agent layer
Commit cdffa11 implements a mock APM Server, in order to make the testing module as standalone as possible. This impacts the testing strategy as follows :
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work on this!
apm-lambda-extension/e2e-testing/sam-node/sam-testing-node/tests/unit/test-handler.js
Outdated
Show resolved
Hide resolved
...lambda-extension/e2e-testing/sam-java/sam-testing-java/src/test/java/helloworld/AppTest.java
Outdated
Show resolved
Hide resolved
The latest commit focuses on refactoring the execution of the test so that the execution is not blocked by a hanging test. Changes
|
Just wanted to document here that we had a slack convo about simplifying the test script to only run one language, which would be specified via args. The test runner could parallelize as needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of questions and comments. It's almost complete 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Motivation / Summary
The work leading to this PR was initiated based on PR #67, which is effectively replaced by the following Pull Request. The objective is to provide contributors with an automated method to test the APM data flow end-to-end, in the context of AWS lambda functions.
Files
This PR adds a subfolder
e2e-testing
to the extension folder. This subfolder contains a Go scripte2e_test.go
, which is the end-to-end test method itself. Alongside the Go script, an additional.gitignore
three folders containing the lambda function to be built are provided. These three folders correspond to the 3 languages for which the APM agent currently supports the AWS Lambda extension : Javascript (Node), Python and Java.Checklist
main
packageAdd an additional check to confirm that the APM extension is running and healthy in the test containersMake the test usable with both a local Elasticsearch instance and a Cloud instanceHow to test
apm-lambda-extension/e2e-testing
, create a .env file and set the following environment variable :Note that if you do not set
RUN_E2E_TESTS
, the test will be skipped.