-
Notifications
You must be signed in to change notification settings - Fork 370
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
refactor: remove usage of async module #702
refactor: remove usage of async module #702
Conversation
Codecov Report
@@ Coverage Diff @@
## master #702 +/- ##
=======================================
Coverage 96.77% 96.77%
=======================================
Files 9 9
Lines 1149 1149
Branches 294 294
=======================================
Hits 1112 1112
Misses 9 9
Partials 28 28
Continue to review full report at Codecov.
|
a6db7e0
to
b33b94e
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.
This is such a huge improvement. Thank you!
system-test/storage.ts
Outdated
import * as crypto from 'crypto'; | ||
import * as fs from 'fs'; | ||
import fetch from 'node-fetch'; | ||
const normalizeNewline = require('normalize-newline'); | ||
const pLimit = require('p-limit'); |
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 pLimit = require('p-limit'); | |
import pLimit = require('p-limit'); |
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.
Fixed, thanks
system-test/storage.ts
Outdated
import * as crypto from 'crypto'; | ||
import * as fs from 'fs'; | ||
import fetch from 'node-fetch'; | ||
const normalizeNewline = require('normalize-newline'); | ||
const pLimit = require('p-limit'); | ||
const {promisify} = require('util'); |
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 {promisify} = require('util'); | |
import {promisify} from 'util'; |
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.
Fixed as well, thanks
system-test/storage.ts
Outdated
}), | ||
done | ||
after(async () => { | ||
Promise.all( |
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.
Missing the await
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.
added await, thanks
system-test/storage.ts
Outdated
age: 30, | ||
isLive: 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.
weird formatting - would expect a semicolon here
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.
True, fixed it
system-test/storage.ts
Outdated
} | ||
); | ||
await bucket.lock(bucket.metadata.metageneration); | ||
try { |
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.
Please use an assert.rejects
here so we're 100% sure the exception was thrown
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.
Done, thanks
system-test/storage.ts
Outdated
); | ||
return Promise.all( | ||
FILES.map(file => | ||
file.setMetadata({temporaryHold: null}).then(() => file.delete()) |
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.
The mix of promises and async/await is weird. Can we just use an async function here and awaits?
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.
Changed that, thanks
system-test/storage.ts
Outdated
}); | ||
const [file] = await bucket.upload(FILES.logo.path, opts); | ||
const [copiedFile] = await file!.copy('CloudLogoCopy'); | ||
await Promise.all([file!.delete, copiedFile!.delete()]); |
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.
Should this be file.delete()
?
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 it should, fixed, thanks
Thank you. |
@JustinBeckwith PTAL |
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 looks reasonable to me, if @JustinBeckwith has already given his 👍 I say ship it.
Towards googleapis/google-cloud-node/issues/2883