Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUMULUS-436: Add activities support to @cumulus/integration-tests #277

Merged

Conversation

abarciauskas-bgse
Copy link
Contributor

@abarciauskas-bgse abarciauskas-bgse commented Mar 26, 2018

Summary: Adds support for testing output of activities in workflow tests

Addresses CUMULUS-436: Cumulus Integration Tests should include an ECS task

Changes

  • Replaces integration-tests/lambda.js with integration-tests/sfnStep.js and removes many reference to lambda
  • sfnStep.js includes LambdaStep and ActivityStep classes which inherit from SfnStep
  • Update CHANGELOG
  • Update exports from integration-tests/index.js

Test Plan

}

const succeededDetails = JSON.parse(stepExecution.completeEvent[this.eventDetailsKeys.succeeded].output.toString());
return succeededDetails;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpicky, but you don't need to define succeededDetails, you could just return the value.

@sethvincent
Copy link
Contributor

This changes the API for getting the lambda output from getLambdaOutput to lambdaStep.getStepOutput so should technically be a major version bump and I'd put that change under Changed in addition to what's under Added.

@@ -69,11 +69,13 @@ async function waitForCompletedExecution(executionArn) {
let statusCheckCount = 0;

// While execution is running, check status on a time interval
/* eslint-disable no-await-in-loop */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I usually prefer to add the eslint-disable comment on the same line that is causing the error. So, something like this:

await timeout(waitPeriodMs); // eslint-disable-line no-await-in-loop

@@ -123,7 +125,7 @@ async function startWorkflowExecution(workflowArn, inputFile) {
async function executeWorkflow(stackName, bucketName, workflowName, inputFile) {
const workflowArn = await getWorkflowArn(stackName, bucketName, workflowName);
const execution = await startWorkflowExecution(workflowArn, inputFile);
const executionArn = execution.executionArn;
const { executionArn } = execution;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two lines could just be

const { executionArn } = await startWorkflowExecution(workflowArn, inputFile);

return eventScheduled && isStepEvent;
});

if (scheduleEvent === null || scheduleEvent === undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could just be if (!scheduleEvent) {

Copy link
Contributor

@marchuffnagle marchuffnagle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a couple of small suggestions but, overall, 👍

@abarciauskas-bgse
Copy link
Contributor Author

Thanks @laurenfrederick @yjpa7145 for your reviews! Addressed comments and just waiting for CI to pass before merging.

@abarciauskas-bgse abarciauskas-bgse merged commit 31a96f1 into master Mar 29, 2018
@scisco scisco deleted the abarciauskas-bgse_integration-tests-activities branch March 30, 2018 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants