-
Notifications
You must be signed in to change notification settings - Fork 30
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
Enabling profiling also causes snapshot test instability #359
Comments
Hi Matthew! Thanks for reporting this issue. That sounds like a very useful suggestion. We'll prioritize this and keep you updated here |
Add the ability to override the git sha and repo url to make snapshot testing easier. JIRA: https://datadoghq.atlassian.net/browse/SVLS-6260 Github Issue: #359
Add the ability to override the git sha and repo url to make snapshot testing easier. JIRA: https://datadoghq.atlassian.net/browse/SVLS-6260 Github Issue: #359
* Add git sha and url overrides Add the ability to override the git sha and repo url to make snapshot testing easier. JIRA: https://datadoghq.atlassian.net/browse/SVLS-6260 Github Issue: #359 * Fix test name Fix duplicated test name from comment
Hi @mbonig, as of 1.24.0 you can now override the git metadata from your test by calling the
|
This is slightly annoying, as it requires me to expose the underlying lambda and I'd prefer not to do that. Could this be a context variable instead? Something like:
See a similar scenario here: |
Expected Behavior
When snapshot testing a stack with a DD-enabled Lambda function, I'd expect the snapshot tests to remain stable. This is not currently possible without injecting the following code before any constructs are loaded:
(and is horribly fragile)
Ideally, a context variable should be available that would allow me to choose, during tests, to mock the hash value to create stability. This has been done with good success in other projects, like:
https://github.com/wheatstalk/cdk-intrinsic-validator?tab=readme-ov-file#tips
Actual Behavior
When enabling profiling on Lambda functions, a DD_TAG environment variable is added which includes the commit hash. This causes a constant churn if using snapshot tests.
Steps to Reproduce the Problem
Specifications
Stacktrace
The text was updated successfully, but these errors were encountered: