Skip to content

fix(e2e): move deletion of sqs queues to After call #3948

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

Merged
merged 7 commits into from
Sep 14, 2022

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Sep 14, 2022

Issue

Alternative to #3918

Description

Move deletion of sqs queues to After call. This way, the queues will get deleted even if integration test fails

Testing

Verified that cleanup happens when:

Integration tests are successful
$ aws sqs list-queues

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

3 scenarios (3 passed)
13 steps (13 passed)
0m01.761s (executing steps: 0m01.710s)
Done in 2.91s.

# Wait for up to 60 seconds, as queue deletion can take that much time
$ aws sqs list-queues
Integration tests fail
$ git diff
diff --git a/features/sqs/messages.feature b/features/sqs/messages.feature
index 23612b4de3..9589a28ca8 100644
--- a/features/sqs/messages.feature
+++ b/features/sqs/messages.feature
@@ -8,7 +8,7 @@ Feature: SQS Messages
     Given I create a queue with the prefix name "aws-js-sdk"
     When I send the message "HELLO"
     Then the result should include a message ID
-    And the result should have an MD5 digest of "eb61eead90e3b899c6bcbe27ac581660"
+    And the result should have an MD5 digest of "eb61eead90e3b899c6bcbe27ac581661"
     And I should eventually be able to receive "HELLO" from the queue
 
   Scenario: Binary payloads
   
$ aws sqs list-queues

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

Failures:

1) Scenario: Send an SQS message # features/sqs/messages.feature:7
   ✔ Before # features/extra/hooks.js:15
   ✔ Before # features/sqs/step_definitions/sqs.js:3
   ✔ Given I create a queue with the prefix name "aws-js-sdk" # features/sqs/step_definitions/queues.js:3
   ✔ When I send the message "HELLO" # features/sqs/step_definitions/messages.js:3
   ✔ Then the result should include a message ID # features/sqs/step_definitions/messages.js:7
   ✖ And the result should have an MD5 digest of "eb61eead90e3b899c6bcbe27ac581661" # features/sqs/step_definitions/messages.js:12
       AssertionError [ERR_ASSERTION]: 'eb61eead90e3b899c6bcbe27ac581660' == 'eb61eead90e3b899c6bcbe27ac581661'
           + expected - actual
       
           -eb61eead90e3b899c6bcbe27ac581660
           +eb61eead90e3b899c6bcbe27ac581661
       
           at Object.<anonymous> (/local/home/trivikr/workspace/aws-sdk-js-v3/features/sqs/step_definitions/messages.js:13:15)
   - And I should eventually be able to receive "HELLO" from the queue # features/sqs/step_definitions/messages.js:17
   ✔ After # features/sqs/step_definitions/sqs.js:12

3 scenarios (1 failed, 2 skipped)
13 steps (1 failed, 9 skipped, 3 passed)
0m00.555s (executing steps: 0m00.506s)

# Wait for up to 60 seconds, as queue deletion can take that much time
$ aws sqs list-queues

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 chore(deps-dev): switch to @cucumber/[email protected] fix(e2e): move deletion of sqs queues to After call Sep 14, 2022
@trivikr trivikr force-pushed the cleanup-sqs-integ-test branch from 76bac2a to 62966fb Compare September 14, 2022 15:41
@trivikr trivikr force-pushed the cleanup-sqs-integ-test branch from f955340 to 9f908ab Compare September 14, 2022 16:37
@trivikr trivikr force-pushed the cleanup-sqs-integ-test branch from 24b7dfd to d33c8d9 Compare September 14, 2022 18:32
@trivikr trivikr marked this pull request as ready for review September 14, 2022 18:36
@trivikr trivikr requested a review from a team as a code owner September 14, 2022 18:36
@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 29, 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