Skip to content

Instantly share code, notes, and snippets.

@stephenplusplus
stephenplusplus / logging-issue-943.js
Last active December 7, 2020 15:02
logging-issue-943
const assert = require('assert');
const Logging = require('@google-cloud/logging').Logging;
const v4 = require('uuid').v4;
const TESTS_PREFIX = 'issue-943';
const TIME_TEST_STARTED = new Date().toISOString();
const NUM_LOGS_TO_CREATE = 50;
const NUM_ENTRIES_TO_WRITE = 100000;
const FLUSH_AFTER_NUM_LOGS_FILLED = NUM_LOGS_TO_CREATE / 10;
@stephenplusplus
stephenplusplus / compute-pr-522.diff
Created November 30, 2020 23:37
compute-pr-522
diff --git a/system-test/compute.js b/system-test/compute.js
index 5dbc948..daefd4b 100644
--- a/system-test/compute.js
+++ b/system-test/compute.js
@@ -20,7 +20,6 @@ const uuid = require('uuid');
const {promisify} = require('util');
const Compute = require('../');
-const {execSync} = require('child_process');
@stephenplusplus
stephenplusplus / compute-pr-500.diff
Created September 30, 2020 14:14
compute-pr-500
diff --git a/test/zone.js b/test/zone.js
index 456ed28..6c03fd6 100644
--- a/test/zone.js
+++ b/test/zone.js
@@ -775,6 +775,24 @@ describe('Zone', () => {
],
};
+ describe('config.template', () => {
+ const CONFIG = {
@stephenplusplus
stephenplusplus / storage-1135.diff
Created April 27, 2020 15:44
storage-1135.diff
diff --git a/test/bucket.ts b/test/bucket.ts
index be5b013..51e653b 100644
--- a/test/bucket.ts
+++ b/test/bucket.ts
@@ -21,6 +21,8 @@ import {
} from '@google-cloud/common';
import arrify = require('arrify');
import * as assert from 'assert';
+import * as extend from 'extend';
+import * as fs from 'fs';
diff --git a/src/table.ts b/src/table.ts
index cbe2d59..e900829 100644
--- a/src/table.ts
+++ b/src/table.ts
@@ -1102,20 +1102,16 @@ class Table extends common.ServiceObject {
this.bigQuery.createJob(body, callback!);
}
- createLoadJob(source: string, metadata?: JobLoadMetadata): Writable;
- createLoadJob(source: File, metadata?: JobLoadMetadata): Promise<JobResponse>;
'use strict'
const express = require('express')
const {Storage} = require('@google-cloud/storage')
const app = express()
app.get('*', async (req, res) => {
const gcs = new Storage()
try {
{
"name": "gissue-506",
"version": "1.0.0",
"scripts": {
"test": "node ./test.js"
},
"dependencies": {
"@google-cloud/bigtable": "^2.0.1",
"p-queue": "^6.0.2",
"uuid": "^3.0.1"
{
"name": "gissue-763",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "node ./test.js"
},
"keywords": [],
"author": "",
@stephenplusplus
stephenplusplus / index.js
Last active July 3, 2019 01:15
split-array-stream Potential Evolution
const {Readable, Transform} = require('stream');
// SplitArrayStream can be used two ways:
//
// - An intermediary stream that receives arrays and emits its items
// - A source stream that takes a function as an argument, that is expected to
// return an array each time it is called
//
// In both cases, an array is only asked for when the destination stream is
// ready.
@stephenplusplus
stephenplusplus / index.js
Created May 6, 2019 17:58
@google-cloud/storage Issue 674
'use strict'
const fs = require('fs-extra')
const {Storage} = require('@google-cloud/storage')
const gcs = new Storage()
const bucket = gcs.bucket(process.env.BUCKET_NAME)
const tmpFilePath = './tmp-file'
const tmpItemFilePath = './tmp-item-file'