2021-01-15 - Integration Testing - Adding DynamoDB result tests
Goal is to check DynamoDB results at the end of processing any Lambda stage.
There is no way to ensure the order Lambda output results will arrive and be processed by Integration Testing so should only test data that will not change during other stages.
building the configuration
2020-10-01 - Integration Testing - Lambda Functions:initiateTest
if have any stage has dynamoDbOutput set, use lambdaEndpoint_getEventTests to pull in the dynamoDbOutput eventTag, put into that dynamoDbOutput element's object as eventConfig property.
performing the tests
2020-10-01 - Integration Testing - Lambda Functions:receiveMsgOutput
(if can use checkOutputEventOneLevel to compare DynamoDB item with dynamodbOutputCfg.eventConfig): Planning on any not matching properties to go into propertyNotPass array, mixed with Lambda response properties that do not pass.
Add an extra parameter to checkOutputEventOneLevel function: notPassPrefix, this gets passed each level of checkOutputEventOneLevel invocation, default to "". When propertyNotPass.push add this string before propertyName.
After running checkOutputEventOneLevel:
- if resultTag == 'outputResult' && testRecord.Item.stages[matchingStageKey].stageConfig.dynamodbOutput exists
- iterate testRecord.Item.stages[matchingStageKey].stageConfig.dynamodbOutput as variable: dynamodbOutputCfg
- use dynamodbOutputCfg.eventConfig.keyValues to create query keys
- do a get to pull record from DynamoDB table
- should be able to use checkOutputEventOneLevel function to compare DynamoDB item with dynamodbOutputCfg.eventConfig, set notPassPrefix to "DynamoDB result {eventTag}.{propertyName}"
- iterate testRecord.Item.stages[matchingStageKey].stageConfig.dynamodbOutput as variable: dynamodbOutputCfg