integ-tests: better assertion data handling #23231
Labels
@aws-cdk/integ-tests
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p1
Describe the feature
Currently assertions can do retrieve data with two different purposes.
For example, If I want to retrieve a message from a SQS queue
I would first retrieve the data
And then I might want to assert some value
Or I might want to retrieve a value to use later
In this case the custom resource should only return the token (currently it returns the entire object and you just get a reference to the token attribute).
Use Case
See above
Proposed Solution
Currently we retrieve the data and (optionally) flatten it in the sdk handler. We are also automatically attempting to parse any JSON strings in the response. Instead we should just be returning the entire response from this handler and allow the other handlers to process the data.
Using the above example, the sdk handler would return the entire message response as is. Then the assertion handler would perform any assertions and return the result of the assertion. To do this we need to introduce some functionality to parse any JSON strings that are part of the response.
One method could be to introduce some special string like
<PARSE>
which tells the provider to parse the next item.This same method could be used in the handler that will return any values
Other Information
No response
Acknowledgements
CDK version used
any
Environment details (OS name and version, etc.)
any
The text was updated successfully, but these errors were encountered: