Skip to content

Commit

Permalink
make sure buckets get deleted after the job
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Jul 12, 2024
1 parent 18177f6 commit e790b37
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
16 changes: 13 additions & 3 deletions tests/functions/S3Download.cfc
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3" {

function beforeAll() {
variables.cred=Util::getAWSCredentials();
variables.bucketName = Util::createBucketName("download");
}

function afterAll() {
deleteBucketEL(variables.cred,variables.bucketName);
}


function run( testResults , testBox ) {
describe( title="Test suite for S3Download()",skip=Util::isAWSNotSupported(), body=function() {

var cred=Util::getAWSCredentials();
var bucketName=Util::createBucketName("download");
var cred = variables.cred;
var bucketName = variables.bucketName;
var objectName="sub/test.txt";
var content="Susi
Sorglos";
Expand Down
14 changes: 11 additions & 3 deletions tests/general/BigBucket.cfc
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3" {

function beforeAll() {
variables.cred=Util::getAWSCredentials();
variables.bucketName = Util::createBucketName("big");
}

function afterAll() {
deleteBucketEL(variables.cred,variables.bucketName);
}

function run( testResults , testBox ) {

describe( title="Test suite for big buckets",skip=Util::isAWSNotSupported(), body=function() {
var cred=Util::getAWSCredentials()
var bucketName=Util::createBucketName("big");

// does the bucket exists?
if(!S3Exists(
Expand All @@ -23,7 +31,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3" {
var records=qry.recordcount;

if(records==0) {
loop from=1 to=10000 index="i" {
loop from=1 to=100 index="i" {
S3Write(
value:i,
bucketName:bucketName,
Expand Down

0 comments on commit e790b37

Please sign in to comment.