Skip to content

Commit

Permalink
Integration tests get lambda output (#242)
Browse files Browse the repository at this point in the history
**Summary:** @cumulus/integration-tests lambda.js#getLambdaOutput returns entire lambda output, not just he payload.

## Test Plan

- [x] Adhoc testing - tested via `./bin/cli.js workflow --stack-name aimee-deploy-cumulus --bucket-name cumulus-devseed-internal --workflow HelloWorldWorkflow --input-file ./helloWorldInput.json`. This doesn't test this function but it does test it didn't break anything else.
- [x] Update CHANGELOG

Reviewer: @laurenfrederick
  • Loading branch information
abarciauskas-bgse committed Mar 13, 2018
1 parent 519f9a7 commit 14e4161
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Expanded @cumulus/deployment test coverage
- all tasks were updated to use cumulus-message-adapter-js 1.0.1
- added build process to integration-tests package to babelify it before publication
- Update @cumulus/integration-tests lambda.js `getLambdaOutput` to return the entire lambda output. Previously `getLambdaOutput` returned only the payload.

## [v1.1.1] - 2018-03-08

Expand Down
8 changes: 5 additions & 3 deletions packages/integration-tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ async function testWorkflow(stackName, bucketName, workflowName, inputFile) {
}
}

exports.testWorkflow = testWorkflow;
exports.executeWorkflow = executeWorkflow;
exports.getLambdaOutput = lambda.getLambdaOutputPayload;
module.exports = {
testWorkflow,
executeWorkflow,
getLambdaOutput: lambda.getLambdaOutput
};
6 changes: 3 additions & 3 deletions packages/integration-tests/lambda.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async function getLambdaExecution(workflowExecutionArn, lambdaName) {
* @param {string} lambdaName - name of the lambda
* @returns {Object} object containing the payload, null if error
*/
async function getLambdaOutputPayload(workflowExecutionArn, lambdaName) {
async function getLambdaOutput(workflowExecutionArn, lambdaName) {
const lambdaExecution = await getLambdaExecution(workflowExecutionArn, lambdaName);

if (lambdaExecution === null) {
Expand All @@ -83,7 +83,7 @@ async function getLambdaOutputPayload(workflowExecutionArn, lambdaName) {
}

const succeededDetails = JSON.parse(lambdaExecution.completeEvent.lambdaFunctionSucceededEventDetails.output.toString());
return succeededDetails.payload;
return succeededDetails;
}

exports.getLambdaOutputPayload = getLambdaOutputPayload;
exports.getLambdaOutput = getLambdaOutput;

0 comments on commit 14e4161

Please sign in to comment.