-
Notifications
You must be signed in to change notification settings - Fork 107
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 200 #223
Cumulus 200 #223
Conversation
|
||
program | ||
.usage('TYPE COMMAND [options]') | ||
.option('-s, --stack-name <stackName>', 'AWS Cloud Formation stack name', null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this command will fail if any of these options are not set, that should be detected and handled. Right now there is nothing checking to see if these options (all of which are necessary) are set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
packages/integration-tests/index.js
Outdated
* @param {string} workflowName - workflow name | ||
* @returns {string} - workflow arn | ||
*/ | ||
async function getWorkflowArn(stackName, bucketName, workflowName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not an async function. await
is never used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
packages/integration-tests/index.js
Outdated
* @param {string} stackName - Cloud formation stack name | ||
* @param {string} bucketName - S3 internal bucket name | ||
* @param {string} workflowName - workflow name | ||
* @returns {string} - workflow arn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This returns a promise. @returns {Promise.<string>} - workflow arn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed this change.
packages/integration-tests/index.js
Outdated
* @param {string} workflowName - workflow name | ||
* @returns {Object} template as a JSON object | ||
*/ | ||
async function getWorkflowTemplate(stackName, bucketName, workflowName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not an async function, await
is never used.
Should there be tests for this code? |
packages/integration-tests/index.js
Outdated
|
||
// Give this execution a unique name | ||
parsedInput.cumulus_meta.execution_name = uuidv4(); | ||
parsedInput.cumulus_meta.workflow_start_time = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this being set to null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idk because I am a dum dum.
packages/integration-tests/index.js
Outdated
statusCheckCount++; | ||
} | ||
|
||
if (executionStatus === 'RUNNING' && statusCheckCount === executionStatusNumRetries) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for safety, statusCheckCount >= executionStatusNumRetries
packages/integration-tests/index.js
Outdated
} | ||
|
||
if (executionStatus === 'RUNNING' && statusCheckCount === executionStatusNumRetries) { | ||
console.log(`Execution status check timed out, exceeded ${executionStatusNumRetries} status checks.`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add // eslint-disable-line max-len
at the end of this line so it doesn't complain that the line is too long. In the case of long strings, exceeding the max line length isn't a problem.
packages/integration-tests/index.js
Outdated
* @param {string} bucketName - S3 internal bucket name | ||
* @returns {Object} list as a JSON object | ||
*/ | ||
async function getWorkflowList(stackName, bucketName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is never used and should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good, only a few changes requested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed all the comments. I was thinking about tests to test the integration tests... what are you thinking, using localstack?
* @returns {boolean} - true if all params are not null | ||
*/ | ||
function verifyWorkflowParameters(requiredParams) { | ||
return requiredParams.map((param) => verifyRequiredParameter(param)).includes(false) === false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of requiredParams.map((param) => verifyRequiredParameter(param))
, just requiredParams.map(verifyRequiredParameter)
.
* @returns {boolean} - true if all params are not null | ||
*/ | ||
function verifyWorkflowParameters(requiredParams) { | ||
return requiredParams.map((param) => verifyRequiredParameter(param)).includes(false) === false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little easier to read if it's written as return !requiredParams.map(verifyRequiredParameter).includes(false);
, but that could just be my opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fundamentally opposed to the !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with a couple additional comments.
Summary: Start integration test prototype
Addresses CUMULUS-200: Integration test prototype
Changes
Test Plan
Things that should succeed before merging.
Reviewers: @scisco @yjpa7145 @jennyhliu @sethvincent