-
Notifications
You must be signed in to change notification settings - Fork 15
Add metrics and logs integration testing #2
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
integration_tests/serverless.yml
Outdated
| runtime: nodejs12.x | ||
| handler: src/metric.enhancedMetricTest | ||
| layers: | ||
| - arn:aws:lambda:${self:provider.region}:601427279990:layer:Datadog-Node12-x:${env:LAYER_VERSION} |
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.
I think we should pull the Node layer from the prod account (464622532012). That way we are testing the development version of the extension with the production Lambda Library.
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.
✅
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
| # Todo : retrieve this layer version automatically from AWS | ||
| LAYER_VERSION: 6 |
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.
I would rename this to NODE_LAYER_VERSION to make it more clear which layer we are talking about here.
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.
✅ as we'll add more functions in different languages soon
integration_tests/src/metric.js
Outdated
|
|
||
| async function myTimeoutHandler(event, context) { | ||
| sendDistributionMetric("serverless.lambda-extension.integration-test.count", invocationCount); | ||
| await new Promise(r => setTimeout(r, 30*1000)); //30 sec to be sure |
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.
Nit: For testing timeouts, I prefer to create an infinite loop. That way, the function will definitely time out no matter how I adjust the Lambda timeout setting.
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.
I've adjust it with the max AWS allowed timeout value ✅
| @@ -0,0 +1,59 @@ | |||
| name: build | |||
|
|
|||
| on: push | |||
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.
Weren't we going to run this hourly? Where is that set up?
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.
Also, if the tests fail, will we be notified somehow?
nhinsch
left a comment
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.
This looks great! 💯
I left a few last-minute questions about the GitHub action.
This PR bootstraps the integration tests setup for metrics and logs with the followings scenarios :