Skip to content

Commit bad3dd5

Browse files
committed
fix(s3): use client with LocationConstraint region for waiting/deletion
1 parent c86d1d3 commit bad3dd5

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

features/s3/buckets.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ Feature: Working with Buckets
4747

4848
Scenario: Access bucket following 307 redirects
4949
Given I am using the S3 "us-east-1" region with signatureVersion "s3"
50-
When I create a bucket with the location constraint "EU"
51-
Then the bucket should exist
52-
Then the bucket should have a location constraint of "EU"
53-
Then I delete the bucket
50+
When I create a bucket with the location constraint "eu-west-1"
51+
Then the bucket should exist in region "eu-west-1"
52+
Then the bucket should have a location constraint of "eu-west-1"
53+
Then I delete the bucket in region "eu-west-1"
5454

5555
Scenario: Working with bucket names that contain '.'
5656
When I create a bucket with a DNS compatible name that contains a dot

features/s3/step_definitions/buckets.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,15 @@ When("I create a bucket with the location constraint {string}", function (locati
3131
if (err) {
3232
return callback(err);
3333
}
34-
this.waitForBucketExists(
35-
this.s3,
36-
{
37-
Bucket: bucket,
38-
},
39-
callback
40-
);
34+
callback();
4135
});
4236
});
4337

38+
Then("the bucket should exist in region {string}", function (location, next) {
39+
// Bug: https://github.com/aws/aws-sdk-js-v3/issues/1799
40+
this.waitForBucketExists(new S3({ region: location }), { Bucket: this.bucket }, next);
41+
});
42+
4443
Then("the bucket should have a location constraint of {string}", function (loc, callback) {
4544
const self = this;
4645
self.s3.getBucketLocation(
@@ -55,6 +54,11 @@ Then("the bucket should have a location constraint of {string}", function (loc,
5554
);
5655
});
5756

57+
When("I delete the bucket in region {string}", function (location, callback) {
58+
// Bug: https://github.com/aws/aws-sdk-js-v3/issues/1799
59+
this.request(new S3({ region: location }), "deleteBucket", { Bucket: this.bucket }, callback);
60+
});
61+
5862
When("I put a transition lifecycle configuration on the bucket with prefix {string}", function (prefix, callback) {
5963
const params = {
6064
Bucket: this.bucket,

0 commit comments

Comments
 (0)