Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: refactor test-repl #17926

Closed
wants to merge 1 commit into from
Closed

Conversation

addaleax
Copy link
Member

  • Switch over to async tracking through promises/async fns
  • Remove an unused temp dir refresh
  • Inline the multiline/npm text prompts into expectations
  • Unify handling prompts/stripping prompts out
  • Make sure no unexpected data is received by requireing
    all lines to be matched, rather than chunks received from
    the REPL. This made the test too loose in terms of
    matched lines and too strict in terms of stream chunking
    requirements.
  • Some general cleanup
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test/repl

- Switch over to async tracking through promises/async fns
- Remove an unused temp dir refresh
- Inline the multiline/npm text prompts into expectations
- Unify handling prompts/stripping prompts out
- Make sure no unexpected data is received by requireing
  all *lines* to be matched, rather than chunks received from
  the REPL. This made the test too loose in terms of
  matched lines and too strict in terms of stream chunking
  requirements.
- Some general cleanup
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Dec 31, 2017
@addaleax addaleax added repl Issues and PRs related to the REPL subsystem. dont-land-on-v6.x labels Dec 31, 2017
@addaleax addaleax requested a review from Trott January 2, 2018 15:04
@addaleax
Copy link
Member Author

addaleax commented Jan 2, 2018

Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

LGTM. Is this refactoring related to the issues @bmeck was running into? If so, awesome. If not, it might be good to have him give it a review.

@bmeck
Copy link
Member

bmeck commented Jan 2, 2018

@Trott related in some ways, but a decent number are not related. LGTM

@addaleax
Copy link
Member Author

addaleax commented Jan 2, 2018

@Trott The motivation here was the write chunking issue hinted at in the PR description. If this helps with something else, yay, even though that was not my original goal. :)

Copy link
Contributor

@maclover7 maclover7 left a comment

Choose a reason for hiding this comment

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

This is a really nice revamp -- awesome work!

Left one comment about another possible source of refactoring, feel free to land without, is nonblocking.

@addaleax
Copy link
Member Author

addaleax commented Jan 2, 2018

@maclover7 Sorry – I’m not seeing any comment here?

}
})();

function startTCPRepl() {
Copy link
Contributor

Choose a reason for hiding this comment

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

@addaleax not sure why this didn't go through the first time, hopefully works this time!

Was just suggesting that maybe a factory method could be pulled out of startTCPRepl and startUnixRepl, it seems like there is some duplicated code there.

Copy link
Member Author

Choose a reason for hiding this comment

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

@maclover7 Yeah, I agree :) It’s not 100 % trivial but it would sure be nice to have that! I might do it when I have the time but I think this is okay for now :)

@maclover7
Copy link
Contributor

@maclover7 maclover7 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 6, 2018
@addaleax
Copy link
Member Author

addaleax commented Jan 6, 2018

Landed in d1ad4a9

@addaleax addaleax closed this Jan 6, 2018
addaleax added a commit that referenced this pull request Jan 6, 2018
- Switch over to async tracking through promises/async fns
- Remove an unused temp dir refresh
- Inline the multiline/npm text prompts into expectations
- Unify handling prompts/stripping prompts out
- Make sure no unexpected data is received by requireing
  all *lines* to be matched, rather than chunks received from
  the REPL. This made the test too loose in terms of
  matched lines and too strict in terms of stream chunking
  requirements.
- Some general cleanup

PR-URL: #17926
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
@addaleax addaleax deleted the refactor-test-repl branch January 6, 2018 21:24
@addaleax addaleax mentioned this pull request Jan 6, 2018
2 tasks
@MylesBorins
Copy link
Contributor

This does not land cleanly on v9.x, could it be backported?

@addaleax addaleax added backported-to-v9.x and removed backport-requested-v9.x author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Jan 10, 2018
addaleax added a commit to addaleax/node that referenced this pull request Jan 10, 2018
- Switch over to async tracking through promises/async fns
- Remove an unused temp dir refresh
- Inline the multiline/npm text prompts into expectations
- Unify handling prompts/stripping prompts out
- Make sure no unexpected data is received by requireing
  all *lines* to be matched, rather than chunks received from
  the REPL. This made the test too loose in terms of
  matched lines and too strict in terms of stream chunking
  requirements.
- Some general cleanup

PR-URL: nodejs#17926
@addaleax addaleax mentioned this pull request Jan 10, 2018
4 tasks
evanlucas pushed a commit that referenced this pull request Jan 15, 2018
- Switch over to async tracking through promises/async fns
- Remove an unused temp dir refresh
- Inline the multiline/npm text prompts into expectations
- Unify handling prompts/stripping prompts out
- Make sure no unexpected data is received by requireing
  all *lines* to be matched, rather than chunks received from
  the REPL. This made the test too loose in terms of
  matched lines and too strict in terms of stream chunking
  requirements.
- Some general cleanup

Backport-PR-URL: #18082
PR-URL: #17926
Reviewed-By: Evan Lucas <evanlucas@me.com>
MylesBorins pushed a commit that referenced this pull request May 22, 2018
- Switch over to async tracking through promises/async fns
- Remove an unused temp dir refresh
- Inline the multiline/npm text prompts into expectations
- Unify handling prompts/stripping prompts out
- Make sure no unexpected data is received by requireing
  all *lines* to be matched, rather than chunks received from
  the REPL. This made the test too loose in terms of
  matched lines and too strict in terms of stream chunking
  requirements.
- Some general cleanup

PR-URL: #17926
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jun 14, 2018
- Switch over to async tracking through promises/async fns
- Remove an unused temp dir refresh
- Inline the multiline/npm text prompts into expectations
- Unify handling prompts/stripping prompts out
- Make sure no unexpected data is received by requireing
  all *lines* to be matched, rather than chunks received from
  the REPL. This made the test too loose in terms of
  matched lines and too strict in terms of stream chunking
  requirements.
- Some general cleanup

PR-URL: #17926
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Jul 9, 2018
rvagg pushed a commit that referenced this pull request Aug 16, 2018
- Switch over to async tracking through promises/async fns
- Remove an unused temp dir refresh
- Inline the multiline/npm text prompts into expectations
- Unify handling prompts/stripping prompts out
- Make sure no unexpected data is received by requireing
  all *lines* to be matched, rather than chunks received from
  the REPL. This made the test too loose in terms of
  matched lines and too strict in terms of stream chunking
  requirements.
- Some general cleanup

PR-URL: #17926
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
repl Issues and PRs related to the REPL subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants