-
Notifications
You must be signed in to change notification settings - Fork 20
adding tests for externalclients and gcpservice #2579
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
Conversation
146c259 to
6166515
Compare
| async deleteIfExists() { | ||
| if (this.key === 'externalBackendTestBucket/externalBackendMissingKey') { | ||
| return { succeeded: false }; | ||
| } | ||
| return { succeeded: true }; | ||
| } |
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 don't know how you imagine your futur but you can do :
return { succeeded: this.key !== 'externalBackendTestBucket/externalBackendMissingKey' }
| function invalidDnsBucketNameHandler() { | ||
| return (req, res) => { | ||
| assert(req.headers.host, host); | ||
| assert(req.headers.host, host); |
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 ?
82141f3 to
6166515
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## development/8.3 #2579 +/- ##
===================================================
+ Coverage 71.01% 72.72% +1.71%
===================================================
Files 221 221
Lines 18176 18070 -106
Branches 3773 3737 -36
===================================================
+ Hits 12908 13142 +234
+ Misses 5263 4923 -340
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ed14c60 to
b978085
Compare
e36f845 to
e66bc75
Compare
6e00a70 to
00033b5
Compare
Hello benzekrimaha,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
86bcf63 to
bf05ffe
Compare
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
23c12d3 to
5ca7b1d
Compare
This commit aims to improve code clarity by renaming methods and files related to GCP APIs to more descriptive names. The changes include renaming multipart upload methods and object tagging methods to better reflect their functionality. Enhancing code readability and maintainability. Issue: ARSN-524
This commit remove unused methods from the GcpClient class as they are not needed anymore. Issue: ARSN-524
This commit tackles both the removal of the command wrapper functions in the GcpService as they add no additional functonality, calling the send method directly is a better approach. the class name was also updated to GcpService to better reflect its purpose and avoid confusion with the client. Issue: ARSN-524
Some multipart upload tests were missing coverage for ExternalClients. This commit adds those missing tests. Issue: ARSN-524
5ca7b1d to
e862723
Compare
With the refactor of GCP service within the migration from aws-sdk v2 to v3, we noticed that some code paths were not covered by unit tests. this commit adds tests to cover helper functions and mpu/object tagging related functions. Issue: ARSN-524
cf26f38 to
dbde6ff
Compare
| } | ||
|
|
||
| Object.assign(GcpClient.prototype, gcpApis); | ||
| Object.assign(GcpService.prototype, gcpApis); |
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 move this to the constructor of GcpService, to make it easier to notice?
(or even rewrite this without Object.assign : it was done to "extend" the generated class, but now the class is manually written: so we may more cleanly add the methods?)
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.
Keeping GcpApis separate avoids a noisy/huge diff and makes it easier to iterate on these highly customized APIs in isolation. I kept the Object.assign(GcpService.prototype, gcpApis) at module scope (not in the constructor) because putting it in the constructor would re-run for every new GcpService(), repeatedly overwriting prototype methods.
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.
Yeah not much we can do here. Maybe replace this line with something explicit
| Object.assign(GcpService.prototype, gcpApis); | |
| GcpClient.prototype.abortMultipartUpload = gcpApis.abortMultipartUpload; | |
| GcpClient.prototype.completeMultipartUpload = gcpApis.completeMultipartUpload; | |
| GcpClient.prototype.createMultipartUpload = gcpApis.createMultipartUpload; | |
| ... | |
| ... | |
| ... |
This way it won't be 'hidden' into a single line, but not sure its super nice either
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.
putting it in the constructor would re-run for every new GcpService(), repeatedly overwriting prototype methods.
constructor() {
Object.assign(this, gcpApis);
}
putting it in the constructor would not overwrite prototype method: only the "current" object's methods.
Would that be an issue?
| }; | ||
| } | ||
|
|
||
| async deleteIfExists() { |
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 don't see this function being used anywhere 🤔 except once in code that was already existing in azureClient test. How come the test didn't fail without this function
| }); | ||
|
|
||
| it(`${backend.name} delete() should delete the requested key without error`, async () => { | ||
| const key = 'externalBackendTestKey'; |
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.
nit: seems these key/bucket names are important as they are also hardcoded in the dummy service, but we could consider using constants dummyKey/dummyBucketName defined in dummy service and importing them
francoisferrand
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.
with this, are we ready for 8.3.0 release?
- if we don't have anything, should bump in this PR so we can immediately release
- or align with @DarkIsDude to release once #2581 is merged (on 8.2, with 8.3 waterflow), merge this one "as is", and do the bump #2581.
df3d2aa to
aed443f
Compare
|
/approve |
|
I have successfully merged the changeset of this pull request
The following branches have NOT changed:
Please check the status of the associated issue ARSN-524. Goodbye benzekrimaha. The following options are set: approve |
Issue: ARSN-524