Skip to content

test: general improvements to vm tests - #14458

Closed
jasnell wants to merge 10 commits into
nodejs:masterfrom
jasnell:improve-vm-tests
Closed

test: general improvements to vm tests#14458
jasnell wants to merge 10 commits into
nodejs:masterfrom
jasnell:improve-vm-tests

Conversation

@jasnell

Copy link
Copy Markdown
Member

General improvements to vm tests

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

@nodejs-github-botnodejs-github-bot added the test Issues and PRs related to the tests. label Jul 24, 2017
Comment threadtest/parallel/test-vm-context.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.

Rest is a typo, right?

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.

yep, should have been Test

@mscdexmscdex added the vm Issues and PRs related to the vm subsystem. label Jul 24, 2017
@Trott

Copy link
Copy Markdown
Member

Not objecting enough to stop it, but I'm not a fan of removing console.* calls in tests as a supposed improvement. Those are often super helpful when tests start failing in CI in ways that are difficult to reproduce locally. Seems to favor abstract ideas about how tests are "supposed" to be written over practical considerations.

@jasnell

Copy link
Copy Markdown
MemberAuthor

I've been considering introducing a new common.log() that would be a non-op unless a NODE_TEST_LOG=1 environment variable is set... that would accomplish the same basic thing without introducing the unnecessary noise by default.

@Trott

Copy link
Copy Markdown
Member

I've been considering introducing a new common.log() that would be a non-op unless a NODE_TEST_LOG=1 environment variable is set... that would accomplish the same basic thing without introducing the unnecessary noise by default.

What is the downside of console.log() statements that we are trying to avoid? What is the value we get in return for the added complexity?

(Feel free to take this offline if it's a distraction from the PR generally.)

@jasnell

Copy link
Copy Markdown
MemberAuthor

most of the time the console.log output is generally quite useless in the tests that exist currently. For instance, printing console.log('ok') unconditionally when the test exits, or calling console.log() within unnecessary event handlers, with content that is not very useful, even for simple debugging.

@Trott

Copy link
Copy Markdown
Member

most of the time the console.log output is generally quite useless in the tests that exist currently. For instance, printing console.log('ok') unconditionally when the test exits, or calling console.log() within unnecessary event handlers, with content that is not very useful, even for simple debugging.

If most of the logging is useless (which is an assessment I do not agree with), how does creating a whole new way to control logging improve anything? It seems that it would be better to improve or remove existing log messages.

@Trott

Trott commented Jul 25, 2017

Copy link
Copy Markdown
Member

Although looking more at these specific logging messages...yeah, not sure I get the utility of them. Sorry I said anything here. I should have saved it for something else where the log messages might have value. 😆

@TrottTrott 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.

LGTM if CI is green.

@jasnell

Copy link
Copy Markdown
MemberAuthor

@Trott ... I definitely understand where you're coming from. Introducing a new common.log() type of mechanism and converting over gives us an opportunity to do two things: 1) improve the existing output messages to make them more useful and 2) improve the tests overall. As is evidenced by the recent round of test improvements I've been making, there are a range of improvements that can be made.

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.

The function should be invoked: common.mustNotCall().

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.

Same here.

Trott
Trott previously requested changes Jul 26, 2017

@TrottTrott 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.

Needs nits from @lpinca before landing.

@jasnell

Copy link
Copy Markdown
MemberAuthor

Updated, rebased

@Trott
Trott dismissed their stale reviewAugust 1, 2017 02:31

updated since review, dismissing request for changes

@jasnell

Copy link
Copy Markdown
MemberAuthor

Rebased. CI before landing: https://ci.nodejs.org/job/node-test-pull-request/9445/

@jasnell

Copy link
Copy Markdown
MemberAuthor

Canceled the CI run... there appear to be some issues in CI-land (ping @nodejs/build)

@jasnell

Copy link
Copy Markdown
MemberAuthor

Trying new CI run again: https://ci.nodejs.org/job/node-test-pull-request/9454/

jasnell added a commit that referenced this pull request Aug 3, 2017
PR-URL: #14458
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
@jasnell

Copy link
Copy Markdown
MemberAuthor

Landed 4b23b42

@jasnelljasnell closed this Aug 3, 2017
MylesBorins pushed a commit that referenced this pull request Sep 9, 2017
PR-URL: #14458
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
@MylesBorinsMylesBorins mentioned this pull request Sep 10, 2017
MylesBorins pushed a commit that referenced this pull request Sep 20, 2017
PR-URL: #14458
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
@MylesBorinsMylesBorins mentioned this pull request Sep 20, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testIssues and PRs related to the tests.vmIssues and PRs related to the vm subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

11 participants

@jasnell@Trott@fhinkel@addaleax@lpinca@targos@cjihrig@tniessen@mscdex@MylesBorins@nodejs-github-bot