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

test: fix typescript version in pack-n-play system test#345

Merged
alvarowolfx merged 5 commits intogoogleapis:mainfrom
alvarowolfx:deps-linkinator-node12
Jun 5, 2023
Merged

test: fix typescript version in pack-n-play system test#345
alvarowolfx merged 5 commits intogoogleapis:mainfrom
alvarowolfx:deps-linkinator-node12

Conversation

@alvarowolfx
Copy link
Copy Markdown
Contributor

@alvarowolfx alvarowolfx commented Jun 5, 2023

Pin linkinator to v4.1.2 to avoid Node 16+ req linkinator was not the issue, was actually caused by latest release of Typescript not being compatible with Node 12 ( min requirement 14+ ).

@alvarowolfx alvarowolfx requested a review from a team June 5, 2023 13:04
@product-auto-label product-auto-label Bot added size: xs Pull request size is extra small. api: bigquerystorage Issues related to the googleapis/nodejs-bigquery-storage API. labels Jun 5, 2023
@product-auto-label product-auto-label Bot added size: s Pull request size is small. and removed size: xs Pull request size is extra small. labels Jun 5, 2023
@alvarowolfx alvarowolfx changed the title chore(deps): pin dependency linkinator to v4.1.2 test: fix typescript version in pack-n-play system test Jun 5, 2023
@alvarowolfx
Copy link
Copy Markdown
Contributor Author

Typescript 5.1 was released last week and one of the breaking changes is that Node 14+ is required (https://devblogs.microsoft.com/typescript/announcing-typescript-5-1/#breaking-changes).

This is causing some issues on our repos that uses pack-n-play for installation/system tests under a Node 12 environment. The issue happens because pack-n-play tries to install the latest version of typescript for running tests ( https://github.com/google/pack-n-play/blob/master/src/pack-n-test.ts#L97 ).

@alvarowolfx alvarowolfx added the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 5, 2023
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 5, 2023
Comment thread system-test/install.ts Outdated
try {
await packNTest(options);
} catch (err) {
console.error('TS install failed:', err);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe err here can be omitted, since it's already throwing in the next line, it should end up in stderr the same way:

Suggested change
console.error('TS install failed:', err);
console.error('TS install failed');

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before printing the err, the output of the errors being thrown was not including the output of the pack-n-play function, so was not possible to see where the error was happening. The output was just:

 Error: Process 227 exited with code 1.
      at ChildProcess.<anonymous> (node_modules/pack-n-play/build/src/utils.js:48:22)
          -> /workspace/node_modules/pack-n-play/src/utils.ts:62:11
      at maybeClose (internal/child_process.js:1022:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)

Example: https://source.cloud.google.com/results/invocations/9334fa5b-5323-43b9-b948-d48731060481/targets/cloud-devrel%2Fclient-libraries%2Fnodejs%2Fpresubmit%2Fgoogleapis%2Fnodejs-bigquery-storage%2Fnode12%2Fsystem-test/log

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I see! it looks like pack-n-play is swallowing these errors then 🤔

alright, in this case it sounds reasonable to me to have it printed here for sure! personally I'd put in the next line just to make it more readable, e.g:

Suggested change
console.error('TS install failed:', err);
console.error('TS install failed:\n', err);

but that's def an optional nit

Comment thread system-test/install.ts Outdated
Copy link
Copy Markdown

@ruyadorno ruyadorno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@alvarowolfx alvarowolfx added the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 5, 2023
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 5, 2023
@alvarowolfx alvarowolfx merged commit d0014ff into googleapis:main Jun 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: bigquerystorage Issues related to the googleapis/nodejs-bigquery-storage API. size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants