-
Notifications
You must be signed in to change notification settings - Fork 253
Update functional tests to use cloudserverclient extended commands #6103
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
base: development/9.3
Are you sure you want to change the base?
Changes from all commits
f659ecb
8cf8811
8c4bd96
32201f4
59372f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ | |
| "homepage": "https://github.com/scality/S3#readme", | ||
| "dependencies": { | ||
| "@aws-sdk/client-iam": "^3.930.0", | ||
| "@aws-sdk/client-s3": "^3.908.0", | ||
| "@aws-sdk/client-s3": "^3.1012.0", | ||
| "@aws-sdk/client-sts": "^3.930.0", | ||
| "@aws-sdk/credential-providers": "^3.864.0", | ||
| "@aws-sdk/middleware-retry": "^3.374.0", | ||
|
|
@@ -62,6 +62,7 @@ | |
| }, | ||
| "devDependencies": { | ||
| "@eslint/compat": "^1.2.2", | ||
| "@scality/cloudserverclient": "1.0.7", | ||
| "@scality/eslint-config-scality": "scality/Guidelines#8.3.0", | ||
| "eslint": "^9.14.0", | ||
| "eslint-plugin-import": "^2.31.0", | ||
|
|
@@ -83,7 +84,9 @@ | |
| }, | ||
| "resolutions": { | ||
| "jsonwebtoken": "^9.0.0", | ||
| "nan": "v2.22.0" | ||
| "nan": "v2.22.0", | ||
| "fast-xml-parser": ">=5.5.6", | ||
| "@aws-sdk/xml-builder": ">=3.972.13" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| }, | ||
| "mocha": { | ||
| "recursive": true, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,8 @@ describe('HEAD bucket', () => { | |
| await s3.send(new HeadBucketCommand({ Bucket: '' })); | ||
| assert.fail('Expected failure but got success'); | ||
| } catch (err) { | ||
| assert.strictEqual(err.message, 'Empty value provided for input HTTP label: Bucket.'); | ||
| assert.strictEqual(err.$metadata.httpStatusCode, 405); | ||
| assert.strictEqual(err.name, 'Unknown'); | ||
maeldonn marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The assertion on err.name === 'Unknown' is fragile. If the server returns a proper error code in the future, this test will pass silently even if behavior changes. Consider adding a comment explaining why 'Unknown' is the expected error name here (likely because HEAD responses have no body for error details). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test previously validated SDK client-side input checking (
maeldonn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| }); | ||
| }); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -224,18 +224,6 @@ describe('GET object', () => { | |
| await s3.send(new DeleteBucketCommand({ Bucket: bucketName })); | ||
| }); | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test for empty bucket name was removed, but the equivalent test in |
||
|
|
||
| it('should return an error to get request without a valid ' + | ||
| 'bucket name', | ||
| done => { | ||
| s3.send(new GetObjectCommand({ Bucket: '', Key: 'somekey' })).then(() => { | ||
| assert.fail('Expected failure but got success'); | ||
| }).catch(err => { | ||
| assert.strictEqual(err.message, 'Empty value provided for input HTTP label: Bucket.'); | ||
| return done(); | ||
| }); | ||
| }); | ||
|
|
||
| it('should return NoSuchKey error when no such object', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test for GET object with empty bucket name was removed entirely. Unlike the HEAD bucket test (head.js) which was updated to check the new server-side error behavior, this test was just deleted. If the newer SDK now sends the request to the server instead of rejecting client-side, consider adding a replacement test that asserts the expected server response (as was done for HEAD). |
||
| done => { | ||
| s3.send(new GetObjectCommand({ Bucket: bucketName, Key: 'nope' })).then(() => { | ||
|
|
@@ -1073,7 +1061,7 @@ describeSkipIfCeph('GET object with object lock', () => { | |
| const params = { | ||
| Bucket: bucket, | ||
| Key: key, | ||
| ObjectLockRetainUntilDate: mockDate, | ||
| ObjectLockRetainUntilDate: mockDate.toDate(), | ||
| ObjectLockMode: mockMode, | ||
| ObjectLockLegalHoldStatus: 'ON', | ||
| }; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding
@scality/cloudserverclient(which depends on@aws-sdk/client-s3@^3.1009.0) as a devDependency causes yarn to deduplicate and resolve the production@aws-sdk/client-s3from 3.917.0 to 3.1009.0. This is a much larger jump than the^3.908.0to^3.931.0bump inpackage.jsonsuggests. Ensure this is intentional and that the 3.1009.0 SDK has been validated against the production server code (not just functional tests).— Claude Code