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-3960: Updated PostToCmr task to be able to republish granules #3906

Merged
merged 18 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "localstack return undefined for sqs.receiveMessage"
This reverts commit 548fbf1.
  • Loading branch information
jennyhliu committed Jan 22, 2025
commit 6050fdef8e81fdcda487a299ceadd2965ba5df90
Original file line number Diff line number Diff line change
Expand Up @@ -523,5 +523,5 @@ test.serial('POST does not write to SNS if writing to PostgreSQL fails', async (
WaitTimeSeconds: 10,
});

t.is(Messages, undefined);
t.is(Messages.length, 0);
});
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ test.serial('del() does not publish an SNS message if removing from PostgreSQL f
WaitTimeSeconds: 10,
});

t.is(Messages, undefined);
t.is(Messages.length, 0);
});

test('Attempting to delete a collection with an invalid access token returns an unauthorized response', async (t) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ test.serial('PUT does not publish SNS message if writing to PostgreSQL fails', a
WaitTimeSeconds: 10,
});

t.is(Messages, undefined);
t.is(Messages.length, 0);
});

test.serial('PUT throws InvalidRegexError for invalid granuleIdExtraction', async (t) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/api/tests/endpoints/test-granules.js
Original file line number Diff line number Diff line change
Expand Up @@ -2423,7 +2423,7 @@ test.serial('PATCH() does not write to DynamoDB/SNS if writing to PostgreSQL fai
WaitTimeSeconds: 10,
});

t.is(Messages, undefined);
t.is(Messages.length, 0);
});

test.serial('PATCH rolls back PostgreSQL records and does not write to SNS if writing to Postgres fails', async (t) => {
Expand Down Expand Up @@ -2469,7 +2469,7 @@ test.serial('PATCH rolls back PostgreSQL records and does not write to SNS if wr
WaitTimeSeconds: 10,
});

t.is(Messages, undefined);
t.is(Messages.length, 0);
});

test.serial('PATCH adds granule if it does not exist and returns a 201 status', async (t) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,5 +555,5 @@ test.serial('writePdr() does not publish an SNS message if pdr_sns_topic_arn is
const { Messages } = await sqs().send(
new ReceiveMessageCommand({ QueueUrl, WaitTimeSeconds: 10 })
);
t.is(Messages, undefined);
t.is(Messages.length, 0);
});
14 changes: 7 additions & 7 deletions packages/api/tests/lib/test-publishSnsMessageUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ test.serial('publishSnsMessageByDataType() does not publish an execution SNS mes
);

const { Messages } = await sqs().receiveMessage({ QueueUrl, WaitTimeSeconds: 10 });
t.is(Messages, undefined);
t.is(Messages.length, 0);
});

test.serial('publishSnsMessageByDataType() publishes an SNS message for execution', async (t) => {
Expand Down Expand Up @@ -112,7 +112,7 @@ test.serial('publishSnsMessageByDataType() does not publish a collection SNS mes
);

const { Messages } = await sqs().receiveMessage({ QueueUrl, WaitTimeSeconds: 10 });
t.is(Messages, undefined);
t.is(Messages.length, 0);
});

test.serial('publishSnsMessageByDataType() publishes a collection SNS message for the event type Create', async (t) => {
Expand Down Expand Up @@ -225,7 +225,7 @@ test.serial('publishSnsMessageByDataType() does not publish a PDR SNS message if
);

const { Messages } = await sqs().receiveMessage({ QueueUrl, WaitTimeSeconds: 10 });
t.is(Messages, undefined);
t.is(Messages.length, 0);
});

test.serial('publishSnsMessageByDataType() publishes a PDR SNS message', async (t) => {
Expand Down Expand Up @@ -262,7 +262,7 @@ test.serial('constructCollectionSnsMessage throws if eventType is not provided',
WaitTimeSeconds: 10,
});

t.is(Messages, undefined);
t.is(Messages.length, 0);
});

test.serial('constructCollectionSnsMessage throws if eventType is invalid', async (t) => {
Expand All @@ -279,7 +279,7 @@ test.serial('constructCollectionSnsMessage throws if eventType is invalid', asyn
WaitTimeSeconds: 10,
});

t.is(Messages, undefined);
t.is(Messages.length, 0);
});

test.serial('constructGranuleSnsMessage throws if eventType is not provided', async (t) => {
Expand All @@ -300,7 +300,7 @@ test.serial('constructGranuleSnsMessage throws if eventType is not provided', as
WaitTimeSeconds: 10,
});

t.is(Messages, undefined);
t.is(Messages.length, 0);
});

test.serial('constructGranuleSnsMessage throws if eventType is invalid', async (t) => {
Expand All @@ -322,5 +322,5 @@ test.serial('constructGranuleSnsMessage throws if eventType is invalid', async (
WaitTimeSeconds: 10,
});

t.is(Messages, undefined);
t.is(Messages.length, 0);
});
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ test.serial('writeExecutionRecordFromMessage() does not publish an SNS messagee
t.false(await executionPgModel.exists(knex, { arn: executionArn }));
const { Messages } = await sqs().receiveMessage({ QueueUrl, WaitTimeSeconds: 10 });

t.is(Messages, undefined);
t.is(Messages.length, 0);
});

test.serial('writeExecutionRecordFromMessage() correctly sets both original_payload and final_payload in postgres when execution records are run in sequence', async (t) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/api/tests/lib/writeRecords/test-write-granules.js
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,7 @@ test.serial('writeGranulesFromMessage() does not write to PostgreSQL/SNS if Post
WaitTimeSeconds: 10,
});

t.is(Messages, undefined);
t.is(Messages.length, 0);
});

test.serial('writeGranulesFromMessage() writes a granule and marks as failed if any file writes fail', async (t) => {
Expand Down Expand Up @@ -2083,7 +2083,7 @@ test.serial('writeGranulesFromMessage() does not write a granule to Postgres if
WaitTimeSeconds: 10,
});

t.is(Messages, undefined);
t.is(Messages.length, 0);
});

test.serial('writeGranulesFromMessage() does not persist file records to Postgres if the workflow status is "running"', async (t) => {
Expand Down