-
Notifications
You must be signed in to change notification settings - Fork 254
Cloudserver adaptation post arsenal refacto #6044
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
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 |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| const assert = require('assert'); | ||
| const async = require('async'); | ||
| const arsenal = require('arsenal'); | ||
| const { ListObjectsCommand } = require('@aws-sdk/client-s3'); | ||
| const { GCP, GcpUtils } = arsenal.storage.data.external.GCP; | ||
| const { | ||
| gcpRequestRetry, | ||
|
|
@@ -100,6 +101,19 @@ describe('GCP: Complete MPU', function testSuite() { | |
| before(done => { | ||
| config = getRealAwsConfig(credentialOne); | ||
| gcpClient = new GCP(config); | ||
| gcpClient.listObjects = (params, callback) => { | ||
|
Contributor
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. Just to understand : this was available in Arsenal GcpService but you just removed it and now you are redefining it in all these files, why not keeping it in Arsenal ? I think the GcpService already has several functions that are used for tests only 🤔
Contributor
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. Upon looking : consider updating the gcpClientRetry function : check err.$metadata.statuscode == 429 on top of the existing check err.statusCode == 429.
Contributor
Author
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. even if we added the |
||
| const command = new ListObjectsCommand(params); | ||
|
Contributor
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. same as above, should migrate each test? (and avoid duplicating this piece of code) |
||
| return gcpClient.send(command) | ||
| .then(data => callback(null, data)) | ||
| .catch(err => { | ||
| if (err && err.$metadata && err.$metadata.httpStatusCode && | ||
| err.statusCode === undefined) { | ||
| // eslint-disable-next-line no-param-reassign | ||
| err.statusCode = err.$metadata.httpStatusCode; | ||
| } | ||
| return callback(err); | ||
| }); | ||
| }; | ||
| async.eachSeries(bucketNames, | ||
| (bucket, next) => gcpRequestRetry({ | ||
| method: 'PUT', | ||
|
|
||
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 keep these "legacy" functions, and not migrate the actual tests to the new SDK api?
since this PR is focused, it does not seem like a large change...