Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

Commit a3453de

Browse files
jkwluiofrobots
authored andcommitted
fix(test): block auth during public system tests (#249)
1 parent 787889e commit a3453de

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
"google-proto-files": "^0.17.0",
7777
"is": "^3.2.1",
7878
"lodash.merge": "^4.6.1",
79+
"nock": "^10.0.1",
7980
"protobufjs": "^6.8.8",
8081
"pumpify": "^1.5.1",
8182
"snakecase-keys": "^1.2.0",

system-test/logging.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,19 @@ const BigQuery = require('@google-cloud/bigquery');
2222
const exec = require('methmeth');
2323
const extend = require('extend');
2424
const is = require('is');
25+
const nock = require('nock');
2526
const PubSub = require('@google-cloud/pubsub');
2627
const {Storage} = require('@google-cloud/storage');
2728
const uuid = require('uuid');
2829

2930
const {Logging} = require('../');
3031

32+
// block all attempts to chat with the metadata server (kokoro runs on GCE)
33+
nock('http://metadata.google.internal')
34+
.get(() => true)
35+
.replyWithError({code: 'ENOTFOUND'})
36+
.persist();
37+
3138
describe('Logging', () => {
3239
let PROJECT_ID;
3340
const TESTS_PREFIX = 'gcloud-logging-test';

0 commit comments

Comments
 (0)