(integ-runner): (Snapshot serializer to ignore certain fields)
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the feature
The snapshots created by the integ-runner contain the full templates. There is certain fields that are changing (eg. tags, stack metadata, asset ids) that should not trigger a new test.
In normal snapshots tests we use for example https://github.com/hupe1980/jest-cdk-snapshot to avoid adding these volatile fields to the snapshot, but I have found no way to do the same for integration tests.
### Use Case
This feature would help us to avoid unneccessary re-runs of integration stacks for unrelated changes.
### Proposed Solution
There already seems to be [some logic for the template](https://github.com/aws/aws-cdk/blob/775c58c9b73b877500b739fb1a1e7c21216a834c/packages/%40aws-cdk/integ-runner/lib/runner/snapshot-test-runner.ts#L279). A way to hook into that, or extending it, to cover use cases like ignoring metadata, assets or tags.
### Other Information
_No response_
### Acknowledgements
- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### CDK version used
2.153
### Environment details (OS name and version, etc.)
debian - unrelevant
Contributor guide
Research direction
Start with packages/@aws-cdk/integ-runner/lib/runner/snapshot-test-runner.ts, especially the existing template snapshot logic linked in the issue. Trace how integ-runner compares snapshots and determine how callers could exclude volatile fields such as tags, stack metadata, and asset IDs. Done means integration snapshots can ignore configured fields without unnecessary stack reruns, with coverage for the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100