Skip to content

Commit 0a99f0d

Browse files
authored
Move deletion of SQS queues to After call (#4207)
1 parent fa8ec41 commit 0a99f0d

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

features/sqs/messages.feature

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ Feature: SQS Messages
1010
Then the result should include a message ID
1111
And the result should have an MD5 digest of "eb61eead90e3b899c6bcbe27ac581660"
1212
And I should eventually be able to receive "HELLO" from the queue
13-
Then I delete the SQS queue
1413

1514
Scenario: Binary payloads
1615
Given I create a queue with the prefix name "aws-js-sdk"
1716
When I send the message "HELLO" with a binary attribute
1817
Then the result should include a message ID
1918
And the result should have an MD5 digest of "eb61eead90e3b899c6bcbe27ac581660"
2019
And I should eventually be able to receive "HELLO" from the queue with a binary attribute
21-
Then I delete the SQS queue

features/sqs/queues.feature

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@ Feature: SQS Queues
88
Given I create a queue with the prefix name "aws-js-sdk"
99
And I create a queue with the prefix name "aws-js-sdk"
1010
Then list queues should eventually return the queue urls
11-
Then I delete the SQS queue
12-
Then I delete the SQS queue
1311

1412
Scenario: Making a queue request across regions
1513
Given I have a "SQS" service in the "us-west-1" region
1614
And I create a queue with the prefix name "aws-js-sdk"
1715
When I have a "SQS" service in the "us-east-1" region
18-
Then I delete the SQS queue

features/sqs/step_definitions/queues.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,4 @@ module.exports = function () {
2424
this.request(null, 'listQueues', {}, next);
2525
}, { maxTime: 60 });
2626
});
27-
28-
this.Then(/^I delete the SQS queue$/, function (callback) {
29-
var url = this.createdQueues.pop();
30-
this.request(null, 'deleteQueue', { QueueUrl: url }, callback);
31-
});
32-
3327
};

features/sqs/step_definitions/sqs.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,10 @@ module.exports = function() {
44
this.createdQueues = [];
55
callback();
66
});
7+
8+
this.After("@sqs", async function () {
9+
for (var queueUrl of this.createdQueues) {
10+
await this.service.deleteQueue({QueueUrl: queueUrl}).promise();
11+
}
12+
});
713
};

0 commit comments

Comments
 (0)