From da53ba3970b4818bdfd1cda4a41a94aceab59b2d Mon Sep 17 00:00:00 2001 From: dpebot Date: Fri, 21 Sep 2018 17:29:18 -0700 Subject: [PATCH] Re-generate library using /synth.py --- .circleci/npm-install-retry.js | 2 +- .kokoro/presubmit/node8/samples-test.cfg | 7 +++++++ .kokoro/presubmit/node8/system-test.cfg | 7 +++++++ smoke-test/publisher_smoke_test.js | 14 ++++++-------- src/v1/publisher_client_config.json | 8 ++++++-- src/v1/subscriber_client_config.json | 8 ++++++-- 6 files changed, 33 insertions(+), 13 deletions(-) create mode 100644 .kokoro/presubmit/node8/samples-test.cfg create mode 100644 .kokoro/presubmit/node8/system-test.cfg diff --git a/.circleci/npm-install-retry.js b/.circleci/npm-install-retry.js index ae3220d73..3240aa2cb 100755 --- a/.circleci/npm-install-retry.js +++ b/.circleci/npm-install-retry.js @@ -6,7 +6,7 @@ let spawn = require('child_process').spawn; //USE: ./index.js [... NPM ARGS] // -let timeout = process.argv[2] || 60000; +let timeout = process.argv[2] || process.env.NPM_INSTALL_TIMEOUT || 60000; let attempts = process.argv[3] || 3; let args = process.argv.slice(4); if (args.length === 0) { diff --git a/.kokoro/presubmit/node8/samples-test.cfg b/.kokoro/presubmit/node8/samples-test.cfg new file mode 100644 index 000000000..b0b5906e6 --- /dev/null +++ b/.kokoro/presubmit/node8/samples-test.cfg @@ -0,0 +1,7 @@ +# Download resources for system tests (service account key, etc.) +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-pubsub/.kokoro/samples-test.sh" +} diff --git a/.kokoro/presubmit/node8/system-test.cfg b/.kokoro/presubmit/node8/system-test.cfg new file mode 100644 index 000000000..7d6fa1ba7 --- /dev/null +++ b/.kokoro/presubmit/node8/system-test.cfg @@ -0,0 +1,7 @@ +# Download resources for system tests (service account key, etc.) +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-pubsub/.kokoro/system-test.sh" +} diff --git a/smoke-test/publisher_smoke_test.js b/smoke-test/publisher_smoke_test.js index cae73093e..f2cc1a2d7 100644 --- a/smoke-test/publisher_smoke_test.js +++ b/smoke-test/publisher_smoke_test.js @@ -16,7 +16,7 @@ describe('PublisherSmokeTest', () => { if (!process.env.GCLOUD_PROJECT) { - throw new Error('Usage: GCLOUD_PROJECT= node #{$0}'); + throw new Error("Usage: GCLOUD_PROJECT= node #{$0}"); } const projectId = process.env.GCLOUD_PROJECT; @@ -30,8 +30,7 @@ describe('PublisherSmokeTest', () => { // Iterate over all elements. const formattedProject = client.projectPath(projectId); - client - .listTopics({project: formattedProject}) + client.listTopics({project: formattedProject}) .then(responses => { const resources = responses[0]; for (let i = 0; i < resources.length; i += 1) { @@ -52,6 +51,7 @@ describe('PublisherSmokeTest', () => { // Or obtain the paged response. const formattedProject = client.projectPath(projectId); + const options = {autoPaginate: false}; const callback = responses => { // The actual resources in a response. @@ -67,9 +67,8 @@ describe('PublisherSmokeTest', () => { // Fetch the next page. return client.listTopics(nextRequest, options).then(callback); } - }; - client - .listTopics({project: formattedProject}, options) + } + client.listTopics({project: formattedProject}, options) .then(callback) .then(done) .catch(done); @@ -83,8 +82,7 @@ describe('PublisherSmokeTest', () => { }); const formattedProject = client.projectPath(projectId); - client - .listTopicsStream({project: formattedProject}) + client.listTopicsStream({project: formattedProject}) .on('data', element => { console.log(element); }) diff --git a/src/v1/publisher_client_config.json b/src/v1/publisher_client_config.json index 72dec325a..570837565 100644 --- a/src/v1/publisher_client_config.json +++ b/src/v1/publisher_client_config.json @@ -6,6 +6,11 @@ "DEADLINE_EXCEEDED", "UNAVAILABLE" ], + "http_get": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "non_idempotent": [], "one_plus_delivery": [ "ABORTED", "CANCELLED", @@ -14,8 +19,7 @@ "RESOURCE_EXHAUSTED", "UNAVAILABLE", "UNKNOWN" - ], - "non_idempotent": [] + ] }, "retry_params": { "default": { diff --git a/src/v1/subscriber_client_config.json b/src/v1/subscriber_client_config.json index 0d793ba4f..ce74feb0e 100644 --- a/src/v1/subscriber_client_config.json +++ b/src/v1/subscriber_client_config.json @@ -6,14 +6,18 @@ "DEADLINE_EXCEEDED", "UNAVAILABLE" ], - "non_idempotent": [], "pull": [ "CANCELLED", "DEADLINE_EXCEEDED", "INTERNAL", "RESOURCE_EXHAUSTED", "UNAVAILABLE" - ] + ], + "http_get": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "non_idempotent": [] }, "retry_params": { "default": {