Skip to content

Commit

Permalink
Fix functions/billing on Kokoro (#770)
Browse files Browse the repository at this point in the history
* Change Kokoro image to Node 8

* Add semistandard as a devdependency

* Lint with semistandard
  • Loading branch information
Ace Nassri authored and fhinkel committed Nov 15, 2018
1 parent 04683b0 commit 392b27e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .kokoro/functions/billing.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions functions/billing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down
1 change: 1 addition & 0 deletions functions/billing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
6 changes: 3 additions & 3 deletions functions/billing/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand Down

0 comments on commit 392b27e

Please sign in to comment.