Skip to content

Commit

Permalink
ctst: check result of object creation steps
Browse files Browse the repository at this point in the history
Issue: ZENKO-4928
  • Loading branch information
francoisferrand committed Nov 18, 2024
1 parent f040537 commit d19a7a9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tests/ctst/common/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,20 @@ Given('an existing bucket {string} {string} versioning, {string} ObjectLock {str

Given('{int} objects {string} of size {int} bytes',
async function (this: Zenko, numberObjects: number, objectName: string, sizeBytes: number) {
await addMultipleObjects.call(this, numberObjects, objectName, sizeBytes);
const result = await addMultipleObjects.call(this, numberObjects, objectName, sizeBytes);
assert.ifError(result?.stderr || result?.err);
});

Given('{int} mpu objects {string} of size {int} bytes',
async function (this: Zenko, numberObjects: number, objectName: string, sizeBytes: number) {
await addMultipleObjects.call(this, numberObjects, objectName, sizeBytes, undefined, 1);
const result = await addMultipleObjects.call(this, numberObjects, objectName, sizeBytes, undefined, 1);
assert.ifError(result?.stderr || result?.err);
});

Given('{string} is copied to {string}',
async function (this: Zenko, sourceObject: string, destinationObject: string) {
await copyObject(this, sourceObject, destinationObject);
const result = await copyObject(this, sourceObject, destinationObject);
assert.ifError(result?.stderr || result?.err);
});

Given('{int} objects {string} of size {int} bytes on {string} site',
Expand All @@ -170,17 +173,20 @@ Given('{int} objects {string} of size {int} bytes on {string} site',
} else {
Identity.useIdentity(IdentityEnum.ACCOUNT, Zenko.sites['source'].accountName);
}
await addMultipleObjects.call(this, numberObjects, objectName, sizeBytes);
const result = await addMultipleObjects.call(this, numberObjects, objectName, sizeBytes);
assert.ifError(result?.stderr || result?.err);
});

Given('{int} objects {string} of size {int} bytes with user metadata {string}',
async function (this: Zenko, numberObjects: number, objectName: string, sizeBytes: number, userMD: string) {
await addMultipleObjects.call(this, numberObjects, objectName, sizeBytes, userMD);
const result = await addMultipleObjects.call(this, numberObjects, objectName, sizeBytes, userMD);
assert.ifError(result?.stderr || result?.err);
});

Given('{int} mpu objects {string} of size {int} bytes with user metadata {string}',
async function (this: Zenko, numberObjects: number, objectName: string, sizeBytes: number, userMD: string) {
await addMultipleObjects.call(this, numberObjects, objectName, sizeBytes, userMD);
const result = await addMultipleObjects.call(this, numberObjects, objectName, sizeBytes, userMD);
assert.ifError(result?.stderr || result?.err);
});

Given('a tag on object {string} with key {string} and value {string}',
Expand Down
1 change: 1 addition & 0 deletions tests/ctst/steps/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ async function copyObject(world: Zenko, srcObjectName?: string, dstObjectName?:
const versionId = extractPropertyFromResults<string>(result, 'VersionId');
world.saveCreatedObject(key, versionId || '');
world.setResult(result);
return result;
}

async function putObject(world: Zenko, objectName?: string, content?: string) {
Expand Down

0 comments on commit d19a7a9

Please sign in to comment.