-
Notifications
You must be signed in to change notification settings - Fork 108
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
Ecarton/cumulus 3751 pg update #3916
base: ecarton/cumulus-3751-s3-task
Are you sure you want to change the base?
Ecarton/cumulus 3751 pg update #3916
Conversation
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 some comments/questions and a couple NITS
ingestExecutionArn = await buildAndStartWorkflow( | ||
stackName, | ||
config.bucket, | ||
'IngestAndPublishGranuleWithOrca', |
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 this workflow: 'IngestAndPublishGranuleWithOrca',
? how does that play into this test/task?
); | ||
}); | ||
|
||
describe('under normal circumstances', () => { |
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.
NIT: more descriptive title for this describe
//upload to cumulus | ||
try { | ||
const { $metadata, Payload } = await lambda().send(new InvokeCommand({ | ||
FunctionName: `${stackName}-ChangeGranuleCollectionS3`, |
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.
assuming this needs to be ran first before the PG change? can this be moved to the beforeAll or is it better to just have it here 🤔 since the test is meant to test PG
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.
overall the test looks great 🙌
@@ -0,0 +1,2 @@ | |||
/nyc.config.js |
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.
NIT: should /src/ be included in this file?
const sinon = require('sinon'); | ||
const { createSnsTopic } = require('@cumulus/aws-client/SNS'); | ||
const { generateLocalTestDb, migrationDir, GranulePgModel, CollectionPgModel, translateApiCollectionToPostgresCollection, translateApiGranuleToPostgresGranule, localStackConnectionEnv } = require('@cumulus/db'); | ||
|
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.
for a db test like this, do you not need this stuff:
process.env.AccessTokensTable = randomId('token');
process.env.stackName = randomId('stackname');
process.env.system_bucket = randomId('system-bucket');
process.env.TOKEN_SECRET = randomId('secret');
process.env.backgroundQueueUrl = randomId('backgroundQueueUrl');
); | ||
pgRecords.granules = await granuleModel.insert( | ||
knex, | ||
await Promise.all(granules.map(async (g) => ( |
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.
NIT: naming from g -> granule
t.context.esIndex = esIndex; | ||
t.context.esClient = esClient; | ||
|
||
t.context.knexAdmin = knexAdmin; |
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.
is all this bucket stuff needed just for this? what is it doing in this case?
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.
line 130-160ish
"sampleFileName": "BROWSE.MOD11A1.A2017200.h19v04.006.2017201090724.hdf", | ||
"bucket": "private" | ||
}, | ||
{ |
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.
do you need this for unit tests, why not just use the fakeFactories stuff instead, unless there is a deliberate need I'm not understanding (bc its task/workflow....etc.)?
uploadTestDataToBucket(config.bucket, s3data, sourceGranulePath), | ||
addCollections(stackName, config.bucket, collectionsDir, testSuffix, testId), | ||
addCollections(stackName, config.bucket, targetCollectionsDir, testSuffix, testId), | ||
addProviders(stackName, config.bucket, providersDir, config.bucket, testSuffix), |
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 would you need providers?
Summary: adds Postgres update task to change granules over to new pg details for new collection
Addresses CUMULUS-3751: Develop amazing new feature
Changes
(still need to) add to workflow integration test to include this
PR Checklist