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" 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/package.json b/functions/billing/package.json index 1ea72b22d9..13422b2abb 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" } } 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 = {