Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
180 commits
Select commit Hold shift + click to select a range
b2e12e7
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
3bef808
fix(storage): gaxios migration system test fix
thiyaguk09 May 12, 2026
65f9f33
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
1ae557f
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
2ad0450
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 May 14, 2026
bd33380
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
cc411a0
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
fbeddaf
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 May 14, 2026
128bf0a
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
9010041
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
23ad973
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 May 15, 2026
7b6d68b
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
0e8f067
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
68ef48f
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 May 18, 2026
a2cd00b
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
72c17d7
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
7a7f79a
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 May 19, 2026
8eb2d72
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
eacb087
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
0d254db
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 May 21, 2026
683b3f4
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
0c58a9a
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
5ccfd24
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 May 25, 2026
b5c81a1
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
fe44861
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
b980976
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 May 26, 2026
7c3ee50
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
0a4f5ac
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
ccee09f
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 May 27, 2026
ef7c4d4
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
e3288e3
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
7b15a47
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 1, 2026
eb547c4
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
1fba172
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
68f4fa7
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 2, 2026
fafab27
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
d4b912f
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
0321f89
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 3, 2026
c5be999
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
c0a6220
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
b1c3540
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 4, 2026
c47559b
refactor: wrap done() callback in arrow function block for consistenc…
thiyaguk09 Jun 5, 2026
4865c5d
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
747d276
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
0f2652b
test: add bytes method to mock Gaxios response in acl and headers tests
thiyaguk09 Jun 5, 2026
8117684
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 5, 2026
a82723e
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
e366cc2
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
ffd2057
test: add bytes method to mock Gaxios response in acl and headers tests
thiyaguk09 Jun 5, 2026
55f461b
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 12, 2026
8a0e737
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
4f69ca3
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
2d55123
test: add bytes method to mock Gaxios response in acl and headers tests
thiyaguk09 Jun 5, 2026
afa9dda
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 15, 2026
17ffbe5
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
3b19434
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
7d5c5ac
test: add bytes method to mock Gaxios response in acl and headers tests
thiyaguk09 Jun 5, 2026
6a4b6ce
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 17, 2026
9379a79
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
2c0e9c8
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
7d33276
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 18, 2026
fb221c3
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
696a337
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
9aea402
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 19, 2026
c33b9f8
test: update locationType assertion to verify specific bucket instead…
thiyaguk09 Jun 19, 2026
efaaf4b
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
fe055f7
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
36062af
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 22, 2026
e03e122
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
7218474
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
d4ee55c
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
9271939
lint fix
thiyaguk09 Jun 23, 2026
2dfc7ac
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 23, 2026
de6b408
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
20fcb11
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
9519ae8
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
1819fe4
lint fix
thiyaguk09 Jun 23, 2026
1462379
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 23, 2026
85c50e2
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
0979efb
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
ba27a8f
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
948d035
lint fix
thiyaguk09 Jun 23, 2026
becfad7
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jun 24, 2026
fc44591
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
a81e28d
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
018f71e
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
43fc1e8
lint fix
thiyaguk09 Jun 23, 2026
d7dc4a9
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jun 25, 2026
1946ca8
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
bae6491
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
aeb3a02
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
3217d07
lint fix
thiyaguk09 Jun 23, 2026
816c748
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jun 26, 2026
6723f3e
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
43fc14b
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
3f1dcdf
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
0d373cf
lint fix
thiyaguk09 Jun 23, 2026
f71547a
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jun 29, 2026
0a993d6
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
4f16b2e
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
dae5c48
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
b1a54b0
lint fix
thiyaguk09 Jun 23, 2026
fc267c2
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 1, 2026
de16592
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
82a2239
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
74e6d6b
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
f41a664
lint fix
thiyaguk09 Jun 23, 2026
beda3ad
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 3, 2026
111aa89
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
eaf8c63
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
a5aac31
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
b4ac2f3
lint fix
thiyaguk09 Jun 23, 2026
fe88ba6
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 7, 2026
9a86b22
feat: disable compression on file download requests and clean up test…
thiyaguk09 Jul 8, 2026
ecc3b50
fix: update storage IAM test members and refine error validation logic
thiyaguk09 Jul 8, 2026
cb468a9
fix: decorate GaxiosError with legacy ApiError properties and update …
thiyaguk09 Jul 8, 2026
20e15b0
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
c9e4407
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
01223bc
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
72b5e10
lint fix
thiyaguk09 Jun 23, 2026
ab8ae17
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 8, 2026
b0498ea
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
40f27b2
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
4b31465
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
191e96c
lint fix
thiyaguk09 Jun 23, 2026
955a99b
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 9, 2026
38849e1
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
2e8a5c9
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
929c38d
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
560a61b
lint fix
thiyaguk09 Jun 23, 2026
93f91f8
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 21, 2026
2161bde
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
b52e1f7
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
58ec490
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
99d0a21
lint fix
thiyaguk09 Jun 23, 2026
726f887
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 22, 2026
487c6e3
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
7920b7e
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
a31e5be
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
d8af687
lint fix
thiyaguk09 Jun 23, 2026
eb053d8
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 23, 2026
dbd46bc
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
7e8f9ec
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
ad50970
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
ae0485b
lint fix
thiyaguk09 Jun 23, 2026
89368d3
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 24, 2026
6ea2aee
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
321d91d
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
48db3ca
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
2686699
lint fix
thiyaguk09 Jun 23, 2026
1db4d38
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 27, 2026
106c994
fix(storage): Invocation ID is not retained on multipart upload retri…
thiyaguk09 Jul 28, 2026
bebe7f1
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
8975172
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
b984e82
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
58ef9bf
lint fix
thiyaguk09 Jun 23, 2026
b16d16a
fix(storage): Invocation ID is not retained on multipart upload retri…
thiyaguk09 Jul 28, 2026
505ef1f
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 28, 2026
3f61ccb
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 28, 2026
678f64c
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
676e767
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
fd0a8fc
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
c6cbede
lint fix
thiyaguk09 Jun 23, 2026
374f80d
fix(storage): Invocation ID is not retained on multipart upload retri…
thiyaguk09 Jul 28, 2026
04dc40f
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 28, 2026
f3b5e5f
refactor: simplify system tests by removing uniform bucket-level acce…
thiyaguk09 Jul 28, 2026
4937d6c
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
6ba890f
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
2ad86cc
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
4f26b73
lint fix
thiyaguk09 Jun 23, 2026
7b78138
fix(storage): Invocation ID is not retained on multipart upload retri…
thiyaguk09 Jul 28, 2026
4b3168f
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 29, 2026
d5d17ec
fix: cleanup IAM policy payloads, refactor file upload options, and m…
thiyaguk09 Jul 30, 2026
9875e06
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
7ec256e
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
690b5a1
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
4e72213
lint fix
thiyaguk09 Jun 23, 2026
81b96dc
fix(storage): Invocation ID is not retained on multipart upload retri…
thiyaguk09 Jul 28, 2026
f3feb0a
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 30, 2026
15f7f43
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion handwritten/storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"@types/mime": "3.0.0",
"@types/mocha": "^10.0.10",
"@types/mockery": "^1.4.33",
"@types/node": "^24.0.0",
"@types/node": "^24.13.3",
"@types/node-fetch": "^2.6.12",
"@types/proxyquire": "^1.3.31",
"@types/sinon": "^17.0.4",
Expand Down
10 changes: 6 additions & 4 deletions handwritten/storage/src/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1761,6 +1761,7 @@ class File extends ServiceObject<File, FileMetadata> {
queryParameters: query as unknown as StorageQueryParameters,
responseType: 'stream',
decompress: options.decompress,
compress: false,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as any;

Expand Down Expand Up @@ -4549,7 +4550,8 @@ class File extends ServiceObject<File, FileMetadata> {
dup: Duplexify,
options: CreateWriteStreamOptionsInternal = {},
): void {
options.metadata ??= {};
const opts = options as CreateWriteStreamOptionsInternal;
opts.metadata ??= {};

const apiEndpoint = this.storage.apiEndpoint;
const bucketName = this.bucket.name;
Expand All @@ -4561,7 +4563,7 @@ class File extends ServiceObject<File, FileMetadata> {
uploadType: 'multipart',
},
url,
invocationId: options.invocationId,
invocationId: opts.invocationId,
[GCCL_GCS_CMD_KEY]: options[GCCL_GCS_CMD_KEY],
method: 'POST',
responseType: 'json',
Expand Down Expand Up @@ -4605,12 +4607,12 @@ class File extends ServiceObject<File, FileMetadata> {
reqOpts.multipart = [
{
headers: new Headers({'Content-Type': 'application/json'}),
content: JSON.stringify(options.metadata),
content: JSON.stringify(opts.metadata),
},
{
headers: new Headers({
'Content-Type':
options.metadata.contentType || 'application/octet-stream',
opts.metadata?.contentType || 'application/octet-stream',
}),
content: writeStream,
},
Expand Down
8 changes: 6 additions & 2 deletions handwritten/storage/src/iam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,12 @@ class Iam {
SetPolicyCallback
>(optionsOrCallback, callback);

const policyToSet = {...policy};
delete (policyToSet as any).headers;
delete (policyToSet as any).status;

let maxRetries;
if (policy.etag === undefined) {
if (policyToSet.etag === undefined) {
maxRetries = 0;
}

Expand All @@ -361,7 +365,7 @@ class Iam {
method: 'PUT',
url: `/storage/v1/b/${this.bucket.name}/iam`,
maxRetries,
body: JSON.stringify(policy),
body: JSON.stringify(policyToSet),
headers: {'Content-Type': 'application/json'},
queryParameters: options as unknown as StorageQueryParameters,
},
Expand Down
31 changes: 25 additions & 6 deletions handwritten/storage/src/storage-transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,20 @@ export class StorageTransport {
hasEtagInBody
);

// Helper to enrich GaxiosError objects with legacy ApiError properties
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const decorateError = (err: any) => {
if (err && typeof err === 'object') {
err.code = err.response?.status || err.status || err.code;
if (err.response?.data?.error) {
const apiError = err.response.data.error;
if (apiError.message) err.message = apiError.message;
if (apiError.errors) err.errors = apiError.errors;
}
}
return err;
};

try {
const requestPromise = this.authClient.request<T>({
adapter: async (opts: GaxiosOptions) => {
Expand Down Expand Up @@ -237,20 +251,25 @@ export class StorageTransport {
return data;
};

const enrichedPromise = requestPromise.catch(err => {
throw decorateError(err);
});

if (callback) {
requestPromise
enrichedPromise
.then(resp => callback(null, decorateMetadata(resp), resp))
.catch(err => callback(err, null, err.response));
return requestPromise;
return enrichedPromise;
}

return requestPromise;
return enrichedPromise;
} catch (e) {
const err = decorateError(e);
if (callback) {
callback(e as GaxiosError);
return Promise.reject(e);
callback(err as GaxiosError);
return Promise.reject(err);
}
throw e;
throw err;
}
}

Expand Down
3 changes: 1 addition & 2 deletions handwritten/storage/system-test/fixtures/index-cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// eslint-disable-next-line no-undef
/* eslint-disable node/no-missing-require, no-unused-vars, no-undef */
const {Storage} = require('@google-cloud/storage');

function main() {
// eslint-disable-next-line no-unused-vars
const storage = new Storage();
}

Expand Down
5 changes: 2 additions & 3 deletions handwritten/storage/system-test/fixtures/index-esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// eslint-disable-next-line no-undef
const {Storage} = require('@google-cloud/storage');
/* eslint-disable node/no-missing-import, no-unused-vars */
import {Storage} from '@google-cloud/storage';

function main() {
// eslint-disable-next-line no-unused-vars
const storage = new Storage();
}

Expand Down
2 changes: 1 addition & 1 deletion handwritten/storage/system-test/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('pack-n-play tests', () => {
await packNTest({
sample: {
description: 'Should be able to import the storage library in ESM',
cjs: readFileSync('./system-test/fixtures/index-esm.js').toString(),
ts: readFileSync('./system-test/fixtures/index-esm.js').toString(),
},
});
});
Expand Down
7 changes: 5 additions & 2 deletions handwritten/storage/system-test/kitchen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ describe('resumable-upload', () => {
retryableErrorFn: RETRYABLE_ERR_FN_DEFAULT,
};

const bucket = new Storage({retryOptions}).bucket(bucketName);
const bucket = new Storage({
projectId: process.env.PROJECT_ID,
retryOptions: retryOptions,
}).bucket(bucketName);
let filePath: string;

before(async () => {
Expand Down Expand Up @@ -97,7 +100,7 @@ describe('resumable-upload', () => {
// see: https://cloud.google.com/storage/docs/exponential-backoff:
const ms = Math.pow(2, retries) * 1000 + Math.random() * 2000;
console.info(`retrying "${title}" in ${ms}ms`);
setTimeout(done(), ms);
setTimeout(() => { done(); }, ms);
}

it('should work', done => {
Expand Down
Loading
Loading