Skip to content

Commit

Permalink
chore: delete unused variables (#2052)
Browse files Browse the repository at this point in the history
  • Loading branch information
fhinkel authored Nov 6, 2020
1 parent f5e8de0 commit 764d0fe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
12 changes: 6 additions & 6 deletions functions/billing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const BOT_ACCESS_TOKEN =
process.env.BOT_ACCESS_TOKEN || 'xxxx-111111111111-abcdefghidklmnopq';
const CHANNEL = process.env.SLACK_CHANNEL || 'general';

exports.notifySlack = async (pubsubEvent, context) => {
exports.notifySlack = async pubsubEvent => {
const pubsubAttrs = pubsubEvent.attributes;
const pubsubData = Buffer.from(pubsubEvent.data, 'base64').toString();
const budgetNotificationText = `${JSON.stringify(
Expand All @@ -50,7 +50,7 @@ exports.notifySlack = async (pubsubEvent, context) => {
// [START functions_billing_stop]
const billing = google.cloudbilling('v1').projects;

exports.stopBilling = async (pubsubEvent, context) => {
exports.stopBilling = async pubsubEvent => {
const pubsubData = JSON.parse(
Buffer.from(pubsubEvent.data, 'base64').toString()
);
Expand Down Expand Up @@ -122,7 +122,7 @@ const _disableBillingForProject = async projectName => {
// [END functions_billing_stop]

// Helper function to restart billing (used in tests)
exports.startBilling = async (pubsubEvent, context) => {
exports.startBilling = async pubsubEvent => {
const pubsubData = JSON.parse(
Buffer.from(pubsubEvent.data, 'base64').toString()
);
Expand All @@ -148,7 +148,7 @@ exports.startBilling = async (pubsubEvent, context) => {
const compute = google.compute('v1');
const ZONE = 'us-central1-a';

exports.limitUse = async (pubsubEvent, context) => {
exports.limitUse = async pubsubEvent => {
const pubsubData = JSON.parse(
Buffer.from(pubsubEvent.data, 'base64').toString()
);
Expand Down Expand Up @@ -204,7 +204,7 @@ const _stopInstances = async (projectId, zone, instanceNames) => {
// [END functions_billing_limit]

// Helper function to restart instances (used in tests)
exports.startInstances = async (pubsubEvent, context) => {
exports.startInstances = async () => {
_setAuthCredential();
const instanceNames = await _listStoppedInstances(PROJECT_ID, ZONE);

Expand Down Expand Up @@ -250,7 +250,7 @@ const _startInstances = async (projectId, zone, instanceNames) => {
};

// Helper function used in tests
exports.listRunningInstances = async (pubsubEvent, context) => {
exports.listRunningInstances = async () => {
_setAuthCredential();
console.log(PROJECT_ID, ZONE);
return _listRunningInstances(PROJECT_ID, ZONE);
Expand Down
2 changes: 0 additions & 2 deletions functions/billing/test/periodic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ const promiseRetry = require('promise-retry');
const BASE_URL = process.env.BASE_URL || 'http://localhost:8080';
const cwd = path.join(__dirname, '..');

const {BILLING_ACCOUNT} = process.env;

before(async () => {
// Re-enable compute instances using the sample file itself
const {startInstances, listRunningInstances} = require('../');
Expand Down
3 changes: 0 additions & 3 deletions functions/helloworld/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@
const path = require('path');
const assert = require('assert');
const requestRetry = require('requestretry');
const uuid = require('uuid');
const sinon = require('sinon');
const execPromise = require('child-process-promise').exec;

const program = require('..');
const fileName = `test-${uuid.v4()}.txt`;
const bucketName = process.env.FUNCTIONS_BUCKET;

const startFF = (target, signature, port) => {
const cwd = path.join(__dirname, '..');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('functions_helloworld_pubsub integration test', () => {
assert.strictEqual(response.statusCode, 204);

// Wait for functions-framework process to exit
const {stdout, stderr} = await proc;
const {stdout} = await proc;
assert(stdout.includes('Hello, World!'));
});
// [START functions_pubsub_integration_test]
Expand Down

0 comments on commit 764d0fe

Please sign in to comment.