fix Events v2 APIGW target test and update snapshots #11633
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
When running a new test in Events v2 with APIGW NG enabled, I've encountered test failures due to bad replacement in the snapshots (it would replace the
HTTP
value across the whole snapshot string, leading to very weird error inResponseMetadata
), see the run here: https://app.circleci.com/pipelines/github/localstack/localstack/28547/workflows/b21fae5b-918f-4356-8a18-51b324914127/jobs/249483I've refactored the snapshot logic a bit in order to delete less information from it, for us to be able to validate some assumptions in the
requestContext
, and have a clear idea of what is wrong/need to be fixed in the snapshot via theskip_verify
.It showed that
events
will send specific headers to APIGW, likeX-Amz-Source-Arn
andX-Amz-Source-Account
which might be used by the user's API Gateway integration. As a side-note, it also showedevents
is directly using the Java SDK to send/sign the requests 😄Changes
\cc @cloutierMat