Conversation
b3edcf9 to
e5ced9e
Compare
Current coverage is 90.28% (diff: 100%)@@ master #216 diff @@
==========================================
Files 33 54 +21
Lines 1917 2347 +430
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 333 2119 +1786
+ Misses 1584 228 -1356
Partials 0 0
|
66babd4 to
21fb5ab
Compare
ace-n
left a comment
There was a problem hiding this comment.
Mostly LGTM (other than my comments, and assuming all tests pass).
| // See https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/latest/pubsub/subscription?method=delete | ||
| subscription.delete(function (err, apiResponse) { | ||
| // Lists all subscriptions for the topic | ||
| topic.getSubscriptions((err, subscriptions) => { |
There was a problem hiding this comment.
I'm assuming that this function-calling style is sufficiently idiomatic.
|
|
||
| console.log('Got metadata for subscription: %s', subscriptionName); | ||
| return callback(null, metadata); | ||
| console.log(`Subscription ${subscription.name} created.`); |
There was a problem hiding this comment.
(Same assumption about idiomatic-ness here.)
pubsub/subscriptions.js
Outdated
| console.log('received message: ' + message.data); | ||
| console.log(`Subscription: ${metadata.name}`); | ||
| console.log(`Topic: ${metadata.topic}`); | ||
| console.log(`Push config: %s`, metadata.pushConfig.pushEndpoint); |
There was a problem hiding this comment.
(Nit - I'm assuming we care): is there a way to make this line consistent with the others?
pubsub/subscriptions.js
Outdated
| var ackIds = messages.map(function (message) { | ||
| return message.ackId; | ||
| messages.forEach((message) => { | ||
| console.log(`* ${message.id} %j %j`, message.data, message.attributes); |
There was a problem hiding this comment.
Same nit as above - do we care about consistency in how arguments to console.log are formatted?
There was a problem hiding this comment.
Hmm, I'll pull message.id out, because pulling the other two in doesn't work so well.
| done(); | ||
| }); | ||
| after((done) => { | ||
| pubsub.subscription(subscriptionNameOne).delete(() => { |
There was a problem hiding this comment.
Should we be deleting subscriptionNameTwo as well?
| const output = run(`${cmd} list`, cwd); | ||
| assert.notEqual(output.indexOf(`Subscriptions:`), -1); | ||
| assert.notEqual(output.indexOf(fullSubscriptionNameOne), -1); | ||
| done(); |
There was a problem hiding this comment.
Does fullSubscriptionNameTwo show up here - and if it does, should we check for it?
| // Listing is eventually consistent. Give the indexes time to update. | ||
| const output = run(`${cmd} list ${topicName}`, cwd); | ||
| assert.notEqual(output.indexOf(`Subscriptions for ${topicName}:`), -1); | ||
| assert.notEqual(output.indexOf(fullSubscriptionNameOne), -1); |
There was a problem hiding this comment.
Ditto to above comment (fullSubscriptionNameTwo)
| assert(console.log.calledWith('Published %d message(s)!', messageIds.length)); | ||
| assert.notEqual(apiResponse, undefined); | ||
| console.log(JSON.stringify(messages, null, 2)); | ||
| assert.equal(messages[0].data, message.data); |
There was a problem hiding this comment.
I'm assuming the newest message always comes first, and that we don't have to worry about message order?
There was a problem hiding this comment.
Pub/Sub messages are unordered (they can come in any order).
In this test environment, we know there's only one message because we just created the topic and subscription and published a single message.
| assert(console.log.calledWith('Deleted topic: %s', topicName)); | ||
| assert.notEqual(apiResponse, undefined); | ||
| console.log(JSON.stringify(messages, null, 2)); | ||
| assert.deepEqual(messages[0].data, message); |
There was a problem hiding this comment.
Ditto assumption about message order.
|
Regarding message ordering, I've actually got a new Pub/Sub sample in another branch that shows how to manually enforce ordering with a stateful counter. |
21fb5ab to
eae0a6f
Compare
|
LGTM, assuming that datastore test is better off removed than skipped. 👍 |
|
I just removed the test because you removed the method it was testing in a previous PR. I'm not sure how we missed the test... |
…ds (#216) Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [X] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/nodejs-game-servers/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [X] Ensure the tests and linter pass - [X] Code coverage does not decrease (if any source code was changed) - [X] Appropriate docs were updated (if necessary) Fixes b:179738605 🦕
…ds (#216) Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [X] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/nodejs-game-servers/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [X] Ensure the tests and linter pass - [X] Code coverage does not decrease (if any source code was changed) - [X] Appropriate docs were updated (if necessary) Fixes b:179738605 🦕
…ds (#216) Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [X] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/nodejs-game-servers/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [X] Ensure the tests and linter pass - [X] Code coverage does not decrease (if any source code was changed) - [X] Appropriate docs were updated (if necessary) Fixes b:179738605 🦕
…ds (#216) Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [X] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/nodejs-game-servers/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [X] Ensure the tests and linter pass - [X] Code coverage does not decrease (if any source code was changed) - [X] Appropriate docs were updated (if necessary) Fixes b:179738605 🦕
docs(samples): Adds start of region tag
docs(samples): Adds start of region tag
docs(samples): Adds start of region tag
* updated CHANGELOG.md * updated package.json * updated samples/package.json
* updated CHANGELOG.md * updated package.json * updated samples/package.json
Compare to: