Skip to content

Commit

Permalink
chore: block auth during public system tests (#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored Oct 9, 2018
1 parent 5e58f67 commit a3f2ee3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
"@types/mime": "^2.0.0",
"@types/mime-types": "^2.1.0",
"@types/mocha": "^5.2.3",
"@types/nock": "^9.3.0",
"@types/once": "^1.4.0",
"@types/proxyquire": "^1.3.28",
"@types/pumpify": "^1.4.1",
Expand All @@ -129,6 +130,7 @@
"intelli-espower-loader": "^1.0.1",
"jsdoc": "^3.5.4",
"mocha": "^5.0.0",
"nock": "^10.0.1",
"node-fetch": "^2.2.0",
"normalize-newline": "^3.0.0",
"nyc": "^13.0.0",
Expand Down
8 changes: 7 additions & 1 deletion system-test/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ import * as uuid from 'uuid';
import {util, ApiError, InstanceResponseCallback, BodyResponseCallback} from '@google-cloud/common';
import {Storage, Bucket} from '../src';
import {DeleteBucketCallback} from '../src/bucket';
import * as nock from 'nock';

// block all attempts to chat with the metadata server (kokoro runs on GCE)
nock('http://metadata.google.internal')
.get(url => true)
.replyWithError({code: 'ENOTFOUND'})
.persist();

// tslint:disable-next-line:variable-name
const PubSub = require('@google-cloud/pubsub');
Expand Down Expand Up @@ -113,7 +120,6 @@ describe('storage', () => {

const {Storage} = require('../src');
storageWithoutAuth = new Storage();

done();
});
});
Expand Down

0 comments on commit a3f2ee3

Please sign in to comment.