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

fix(e2e): delete DynamoDB table in AfterAll call #3960

Merged
merged 1 commit into from
Sep 15, 2022

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Sep 15, 2022

Issue

Refs: #3948

Description

Moves deletion of DynamoDB table in AfterAll call

Testing

Success case
$ aws dynamodb list-tables | jq '.TableNames[] | select(startswith("aws-sdk-js-integration"))'

$ yarn run cucumber-js --fail-fast -t @dynamodb
yarn run v1.22.19
$ /local/home/trivikr/workspace/aws-sdk-js-v3/node_modules/.bin/cucumber-js --fail-fast -t @dynamodb
..........................

5 scenarios (5 passed)
16 steps (16 passed)
0m20.360s (executing steps: 0m20.243s)
Done in 21.18s.

$ aws dynamodb list-tables | jq '.TableNames[] | select(startswith("aws-sdk-js-integration"))'

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@trivikr trivikr changed the title fix(e2e): delete DynamoDB table in After call fix(e2e): delete DynamoDB table in AfterAll call Sep 15, 2022
@trivikr trivikr marked this pull request as ready for review September 15, 2022 18:35
@trivikr trivikr requested a review from a team as a code owner September 15, 2022 18:35
AfterAll({ tags: "@dynamodb" }, async function () {
if (tableName) {
const client = new DynamoDB({ maxRetries: 2 });
await client.deleteTable({ TableName: tableName });
Copy link
Contributor

@kuhe kuhe Sep 15, 2022

Choose a reason for hiding this comment

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

I think this should be a queue in case this is modified to have multiple table creation

// outer scope: 
const tableNames = [];

construct: tableNames.push(createdTableName)

destroy: tableNames.forEach(deleteTable)

@trivikr trivikr merged commit b6c0c4a into aws:main Sep 15, 2022
@trivikr trivikr deleted the dynamodb-delete-after branch September 15, 2022 19:31
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants