-
Notifications
You must be signed in to change notification settings - Fork 249
Improvement/cldsrv 724 sur utapi tests #5950
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.1
Are you sure you want to change the base?
Improvement/cldsrv 724 sur utapi tests #5950
Conversation
Hello benzekrimaha,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the |
548afab
to
4d4e5f0
Compare
❌ 366 Tests Failed:
View the top 3 failed test(s) by shortest run time
View the full list of 71 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
3007608
to
5c9cd2c
Compare
As test files depend on these utilities, they needed to be adapted to match the sdk v3 requirements. Issue: CLDSRV-724
fdd6e44
to
9844ffb
Compare
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.
I just have one comment "blocking", it's the behavior change on one of the quota tests, i'm not sure this is needed
next => { | ||
createBucket(bucket, false, next); | ||
}, |
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.
next => { | |
createBucket(bucket, false, next); | |
}, | |
next => createBucket(bucket, false, next); |
assert.ifError(err); | ||
return next(); |
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.
not related to your changes but a quick win could be to just call the next with the error, because an assert in a cb makes it harder to debug, and can even hide the error (as we crash)
// Log what headers we're sending | ||
// eslint-disable-next-line no-console | ||
console.log('Request headers after stripping:', Object.keys(args.request.headers)); |
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.
We can probably remove this console log
}); | ||
|
||
// Add middleware to strip ALL checksum headers | ||
s3Client.middlewareStack.add( |
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 we maybe add a comment to explain why we need this? And maybe a ticket number if that could be removed, so we just support the standard headers
.catch(err => { | ||
callback(err); | ||
}); |
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.
.catch(err => { | |
callback(err); | |
}); | |
.catch(err => callback(err)); |
if (!err && !s3Config.isQuotaInflightEnabled()) { | ||
mockScuba.incrementBytesForBucket(bucket, parts * partSize); | ||
if (!s3Config.isQuotaInflightEnabled()) { | ||
mockScuba.incrementBytesForBucket(bucket, -(parts * partSize)); |
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.
i'm not sure to get why we increment the bytes before the call then we decrement them, is there any issue with the test?
.catch(err => { | ||
cb(err); | ||
}); |
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.
.catch(err => { | |
cb(err); | |
}); | |
.catch(err => cb(err)); |
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.
`catch(cb)
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the |
if (unauthenticated) { | ||
this.s3 = new S3Client({ | ||
...s3Config, | ||
credentials: { accessKeyId: '', secretAccessKey: '' }, | ||
forcePathStyle: true, | ||
signer: { sign: async request => request }, | ||
}); | ||
} | ||
else { | ||
this.s3 = new S3Client({ | ||
...s3Config, | ||
maxAttempts: 0, | ||
}); | ||
} |
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.
if (unauthenticated) { | |
this.s3 = new S3Client({ | |
...s3Config, | |
credentials: { accessKeyId: '', secretAccessKey: '' }, | |
forcePathStyle: true, | |
signer: { sign: async request => request }, | |
}); | |
} | |
else { | |
this.s3 = new S3Client({ | |
...s3Config, | |
maxAttempts: 0, | |
}); | |
} | |
if (unauthenticated) { | |
s3Config = { | |
...s3Config, | |
credentials: { accessKeyId: '', secretAccessKey: '' }, | |
forcePathStyle: true, | |
signer: { sign: async request => request }, | |
}; | |
} | |
this.s3 = new S3Client({ | |
...s3Config, | |
maxAttempts: 0, | |
}); |
Pretty sure that maxAttempts: 0,
is working also for unauthenticated client ?
return this.s3.send(new DeleteBucketCommand({ Bucket: bucketName })) | ||
.catch(err => { | ||
throw err; | ||
}); |
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.
return this.s3.send(new DeleteBucketCommand({ Bucket: bucketName })) | |
.catch(err => { | |
throw err; | |
}); | |
return await this.s3.send(new DeleteBucketCommand({ Bucket: bucketName })); |
One good practice when working with async/await is to always await with return, this will help to preserve the full stack trace (without the await, the stack trace will start at the caller, if you put the await here, the stack trace will display deleteOne
) | ||
.concat((data.DeleteMarkers || []) | ||
.map(object => | ||
this.s3.send(new DeleteObjectCommand({ |
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.
This indent is weird ?
emptyMany(bucketNames) { | ||
const promises = bucketNames.map( | ||
bucketName => this.empty(bucketName) | ||
const promises = bucketNames.map( |
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.
Indent issue ?
return Promise.all(promises); | ||
} | ||
|
||
emptyIfExists(bucketName) { |
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.
I think our guidelines ask us to add a new line between function definition ?
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.
good catch missed it here
request.on('build', () => { | ||
request.httpRequest.headers['x-scal-s3-version-id'] = vID; | ||
}); | ||
// Add custom header using middleware |
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.
// Add custom header using middleware |
} | ||
cb(null, data); | ||
}) | ||
.catch(err => cb(err)); |
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.
.catch(err => cb(err)); | |
.catch(cb); |
.catch(err => { | ||
cb(err); | ||
}); |
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.
`catch(cb)
.catch(err => { | ||
|
||
if (!s3Config.isQuotaInflightEnabled()) { | ||
mockScuba.incrementBytesForBucket(bucket, size); | ||
} | ||
return callback(err); | ||
}); |
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.
.catch(err => { | |
if (!s3Config.isQuotaInflightEnabled()) { | |
mockScuba.incrementBytesForBucket(bucket, size); | |
} | |
return callback(err); | |
}); | |
.catch(err => { | |
if (!s3Config.isQuotaInflightEnabled()) { | |
mockScuba.incrementBytesForBucket(bucket, size); | |
} | |
return callback(err); | |
}); |
nits
}), | ||
next => { | ||
putObject(bucket, key, size, err => { | ||
assert.strictEqual(err.Code, 'QuotaExceeded'); |
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.
Same here, I'm not sure the callback will be called ?
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the |
Issue: CLDSRV-724