Skip to content

tools: add node-pty as a dependency - #47793

Closed
MoLow wants to merge 2 commits into
nodejs:mainfrom
MoLow:pseudo-tty-tests
Closed

tools: add node-pty as a dependency#47793
MoLow wants to merge 2 commits into
nodejs:mainfrom
MoLow:pseudo-tty-tests

Conversation

@MoLow

@MoLowMoLow commented Apr 30, 2023

Copy link
Copy Markdown
Member

this is another followup for #47498 enabling running pseudo-tty snapshot tests using https://github.com/microsoft/node-pty
see #47793 (comment) for the reasoning behind this change

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/actions
  • @nodejs/gyp
  • @nodejs/test_runner

@nodejs-github-botnodejs-github-bot added build Issues and PRs related to build files or the CI. meta Issues and PRs related to the general management of the project. needs-ci PRs that need a full CI run. tools Issues and PRs related to the tools directory. labels Apr 30, 2023
@MoLow
MoLowforce-pushed the pseudo-tty-tests branch 2 times, most recently from 8c96ecf to dc38eb4CompareApril 30, 2023 19:44
@anonrig

anonrig commented Apr 30, 2023

Copy link
Copy Markdown
Member

@MoLow Can you add an eslint rule to inhibit requiring/using node-pty inside lib folder?

@anonriganonrig left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

License file is missing

Comment threadtest/common/assertSnapshot.js Outdated
Comment threadtest/parallel/test-runner-output.mjs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you add a comment to this line and explain what it does?

Comment threadtest/parallel/test-runner-output.mjs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why did we have to change the ordering of this transform? Would it be helpful to document this with a comment?

Comment threadtest/common/assertSnapshot.js Outdated
Comment threadtest/common/assertSnapshot.js Outdated
@mscdex

Copy link
Copy Markdown
Contributor

To avoid confusion with actual deps/ directory changes, I think tools: would be a more appropriate commit message prefix.

@MoLow

MoLow commented May 1, 2023

Copy link
Copy Markdown
MemberAuthor

License file is missing

I think that is relevant for deps, not for tools, see #47793 (comment)
(the license file itself exists but is not exposed, which is ok)

@tniessentniessen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you explain what problem node-pty solves here, and how it worked before?

Comment threadtest/common/assertSnapshot.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should probably be updated.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

why? it still returns Promise<void>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Huh, either GitHub or myself messed up the reference. I meant to select the entire doc comment, not just the @returns line. Specifically, shouldn't a @param be added?

@MoLow

MoLow commented May 1, 2023

Copy link
Copy Markdown
MemberAuthor

Could you explain what problem node-pty solves here, and how it worked before?

Sure. the current pseudo-tty test suite uses an equivilent implementation for this from python:


as part of the effort of migrating the message tests to use common.assertSnapshot this will allow running as any other test under tests/parallel.

common.assertSnapshot has a few advantages over the current python snapshot tests (it is faster, the producing snapshots is not doen maually so it is both easier and deterministic)

@MoLow
MoLowforce-pushed the pseudo-tty-tests branch from dc38eb4 to 5ddce6eCompareMay 1, 2023 16:10
@MoLow

MoLow commented May 1, 2023

Copy link
Copy Markdown
MemberAuthor

@nodejs/node-api any idea why the build is failing on mac? https://github.com/nodejs/node/actions/runs/4846084398/jobs/8635397424

@benjamingr

Copy link
Copy Markdown
Member
 ^
../src/unix/pty.cc:669:10: error: use of undeclared identifier 'openpty'
return openpty(amaster, aslave, name, (termios *)termp, (winsize *)winp);
^
../src/unix/pty.cc:717:10: error: use of undeclared identifier 'forkpty'
return forkpty(amaster, name, (termios *)termp, (winsize *)winp);
^

@mscdexmscdex changed the title deps: add node-pty as a dependencytools: add node-pty as a dependencyMay 1, 2023
@MoLow

MoLow commented May 1, 2023

Copy link
Copy Markdown
MemberAuthor

closing in favor of #47803, wich is much simpler

@MoLowMoLow closed this May 1, 2023
@MoLow
MoLow deleted the pseudo-tty-tests branch May 1, 2023 18:02
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

buildIssues and PRs related to build files or the CI.metaIssues and PRs related to the general management of the project.needs-ciPRs that need a full CI run.toolsIssues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@MoLow@nodejs-github-bot@anonrig@mscdex@benjamingr@tniessen