From d7c9f517c5f53067ab06d209585b5c2be6824682 Mon Sep 17 00:00:00 2001 From: Ace Nassri Date: Mon, 15 Oct 2018 11:48:22 -0700 Subject: [PATCH 1/3] Change Kokoro image to Node 8 --- .kokoro/functions/billing.cfg | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.kokoro/functions/billing.cfg b/.kokoro/functions/billing.cfg index 9668c9d2cb..2c934eb6c2 100644 --- a/.kokoro/functions/billing.cfg +++ b/.kokoro/functions/billing.cfg @@ -6,6 +6,12 @@ env_vars: { value: "functions/billing" } +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:8-user" +} + # Tell the trampoline which build file to use. env_vars: { key: "TRAMPOLINE_BUILD_FILE" From 6ec36e757680de27f9b487a598e93b438b9933f8 Mon Sep 17 00:00:00 2001 From: Ace Nassri Date: Tue, 6 Nov 2018 13:44:06 -0800 Subject: [PATCH 2/3] Add semistandard as a devdependency --- functions/billing/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/functions/billing/package.json b/functions/billing/package.json index 465dd1066b..ef52821b03 100644 --- a/functions/billing/package.json +++ b/functions/billing/package.json @@ -19,6 +19,7 @@ "@google-cloud/nodejs-repo-tools": "^2.2.5", "ava": "^0.25.0", "proxyquire": "^2.1.0", + "semistandard": "^13.0.0", "sinon": "^6.3.4" } } From 635013731e05575756aa132efc9aa5cc63c5093a Mon Sep 17 00:00:00 2001 From: Franziska Hinkelmann Date: Thu, 15 Nov 2018 08:17:13 -0500 Subject: [PATCH 3/3] Lint with semistandard --- functions/billing/index.js | 4 ++-- functions/billing/test/index.test.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/functions/billing/index.js b/functions/billing/index.js index ffe433516d..761a202bfc 100644 --- a/functions/billing/index.js +++ b/functions/billing/index.js @@ -15,8 +15,8 @@ // [START functions_billing_limit] // [START functions_billing_stop] -const {google} = require('googleapis'); -const {auth} = require('google-auth-library'); +const { google } = require('googleapis'); +const { auth } = require('google-auth-library'); const PROJECT_ID = process.env.GCP_PROJECT; const PROJECT_NAME = `projects/${PROJECT_ID}`; diff --git a/functions/billing/test/index.test.js b/functions/billing/test/index.test.js index ef94be98de..99f672f358 100644 --- a/functions/billing/test/index.test.js +++ b/functions/billing/test/index.test.js @@ -98,7 +98,7 @@ function getSample () { } test(`should notify Slack when budget is exceeded`, async t => { - const {program, mocks} = getSample(); + const { program, mocks } = getSample(); const jsonData = { cost: 500, budget: 400 }; const pubsubData = { @@ -112,7 +112,7 @@ test(`should notify Slack when budget is exceeded`, async t => { }); test(`should disable billing when budget is exceeded`, async t => { - const {program, mocks} = getSample(); + const { program, mocks } = getSample(); const jsonData = { cost: 500, budget: 400 }; const pubsubData = { @@ -128,7 +128,7 @@ test(`should disable billing when budget is exceeded`, async t => { }); test(`should shut down GCE instances when budget is exceeded`, async t => { - const {program, mocks} = getSample(); + const { program, mocks } = getSample(); const jsonData = { cost: 500, budget: 400 }; const pubsubData = {