-
Notifications
You must be signed in to change notification settings - Fork 253
Improvement/cldsrv 724 bucket related functional tests #5988
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: improvement/CLDSRV-724-object-related-functional-tests
Are you sure you want to change the base?
Improvement/cldsrv 724 bucket related functional tests #5988
Conversation
Hello benzekrimaha,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
@@ Coverage Diff @@
## improvement/CLDSRV-724-object-related-functional-tests #5988 +/- ##
==========================================================================================
+ Coverage 77.51% 84.35% +6.83%
==========================================================================================
Files 191 204 +13
Lines 12233 12928 +695
==========================================================================================
+ Hits 9483 10906 +1423
+ Misses 2750 2022 -728
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
834eefe to
92f36a8
Compare
c56ac68 to
06547e0
Compare
92f36a8 to
c1fb5b5
Compare
| .then(() => awsRequest(auth, ListObjectsV2Command, { Bucket: testBucket })) | ||
| .then(() => done(new Error('Expected failure'))) | ||
| .catch(cbWithError(done)); | ||
| // Don't return the promise! |
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.
| // Don't return the promise! |
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.
up
| // Use unique bucket name for each test to avoid conflicts | ||
| testBucketName = `${bucketName}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`; |
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.
Could probably be a helper function later shared with all tests?
|
|
||
| } | ||
| }); | ||
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.
| const [pathBase, queryString] = path.split('?'); | ||
| const query = queryString ? Object.fromEntries(new URLSearchParams(queryString)) : {}; | ||
|
|
||
| // Create HTTP request (mimics AWS.HttpRequest with v2-like endpoint structure) |
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.
| // Create HTTP request (mimics AWS.HttpRequest with v2-like endpoint structure) | |
| // Create HTTP request |
| // Rename 'authorization' to 'Authorization' | ||
| if (signedRequest.headers.authorization) { | ||
| signedRequest.headers.Authorization = signedRequest.headers.authorization; | ||
| delete signedRequest.headers.authorization; |
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.
Is this needed? in node the headers are always lowercased
06547e0 to
1166011
Compare
0f033a6 to
3e2bdfc
Compare
DarkIsDude
left a comment
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.
Congrats again 👏
| // Create unsigned client | ||
| const unsignedClient = new BucketUtility('default', { | ||
| ...sigCfg, | ||
| credentials: { accessKeyId: '', secretAccessKey: '' }, | ||
| forcePathStyle: true, | ||
| signer: { sign: async request => request }, | ||
| }); | ||
|
|
||
| // Replace awsAuthMiddleware with a no-op middleware to skip signing |
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.
| // Create unsigned client | |
| const unsignedClient = new BucketUtility('default', { | |
| ...sigCfg, | |
| credentials: { accessKeyId: '', secretAccessKey: '' }, | |
| forcePathStyle: true, | |
| signer: { sign: async request => request }, | |
| }); | |
| // Replace awsAuthMiddleware with a no-op middleware to skip signing | |
| const unsignedClient = new BucketUtility('default', { | |
| ...sigCfg, | |
| credentials: { accessKeyId: '', secretAccessKey: '' }, | |
| forcePathStyle: true, | |
| signer: { sign: async request => request }, | |
| }); | |
| .then(() => awsRequest(auth, ListObjectsV2Command, { Bucket: testBucket })) | ||
| .then(() => done(new Error('Expected failure'))) | ||
| .catch(cbWithError(done)); | ||
| // Don't return the promise! |
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.
up
| 'getObject': GetObjectCommand, | ||
| 'putObject': PutObjectCommand, | ||
| }; | ||
| const CommandCtor = commandMap[operation]; |
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.
CommandCtor what does it mean ?
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.
ia said commandConstructor, but i also didnt find it myself
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.
it is just a diminutif for commandConstructor, used later on in this code
tests/functional/aws-node-sdk/test/bucket/deleteBucketLifecycle.js
Outdated
Show resolved
Hide resolved
tests/functional/aws-node-sdk/test/bucket/deleteBucketLifecycle.js
Outdated
Show resolved
Hide resolved
| Expiration: { Days: 1 }, | ||
| ID: 'test-id', | ||
| Prefix: '', | ||
| Status: 'Enabled', |
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.
Transitions and nunCurrentVersions transitions are undefined instead of [], right ?
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.
yes that's why they're not here the sdk v3 no longer returns the fields when undefined, if ever present I did the adjustment to not have to extend the changes even more
| const res = await bucketUtil.s3.send(new CreateBucketCommand({ | ||
| Bucket: testBucketName, | ||
| CreateBucketConfiguration: { | ||
| LocationConstraint: 'scality-us-west-1', |
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.
Did something failed with the old location constraint ? Is it related to the comment above ?
| }); | ||
| }); | ||
|
|
||
| // NoncurrentVersionTransitions not implemented |
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.
it's a bit weird that you removed the comment, but the test is still skipped. Is it implemented and needs to be tested now ?
| ID: 'id2', | ||
| Status: 'Enabled', | ||
| Prefix: '', | ||
| Expiration: { |
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.
Can you give some context about this changes, Expiration got removed. Also I feel like some tests were removed, or some of them renamed, its a bit hard to track the diff, sometimes the Days parameter is changed from 0 to 1, but sometimes its not changes
| if (err) { | ||
| done(err, data); | ||
| } | ||
| /* generating different prefixes every x > STREAK_LENGTH |
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.
better to keep this ?
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.
why ?
SylvainSenechal
left a comment
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.
only nits and a few questions, but approved alr
e3a5360 to
fc23278
Compare
79eb2ad to
84669aa
Compare
Issue: CLDSRV-724