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,assert: remove internal errorCache property #23304

Closed
wants to merge 3 commits into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Oct 7, 2018

First commit:

test: remove internal errorCache property

The internal assert modules errorCache property is exposed only for
testing. The one test that used it is rewritten here to not use it.

This has the following advantages:

  • The test now makes sure that there is an empty cache in a more robust
    way. Instead of relying on the internal implementation of
    errorCache, it simply spawns a separate process.

  • One less test using the --expose-internals flag.

Second commit:

assert: remove internal errorCache property

The internal assert module exposed an errorCache property solely for
testing. It is no longer necessary. Remove it.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

The internal `assert` modules `errorCache` property is exposed only for
testing. The one test that used it is rewritten here to not use it.

This has the following advantages:

* The test now makes sure that there is an empty cache in a more robust
  way. Instead of relying on the internal implementation of
  `errorCache`, it simply spawns a separate process.
* One less test using the `--expose-internals` flag.
The internal assert module exposed an errorCache property solely for
testing. It is no longer necessary. Remove it.
@nodejs-github-bot nodejs-github-bot added the assert Issues and PRs related to the assert subsystem. label Oct 7, 2018
@Trott
Copy link
Member Author

Trott commented Oct 7, 2018

Copy link
Member

@BridgeAR BridgeAR 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 definitely a good idea!

assert.ok(threw);
} else {
const { writeFileSync } = require('fs');
const [, , , filename, line, column] = process.argv;
Copy link
Member

Choose a reason for hiding this comment

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

I somehow fail to see how the line and column is passed through to the child.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ugh! That's because it's not! Fixed! Thanks.

Copy link
Member Author

Choose a reason for hiding this comment

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

(See line 28. I had line, column missing before.)

@Trott
Copy link
Member Author

Trott commented Oct 8, 2018

Post-fixup CI: https://ci.nodejs.org/job/node-test-pull-request/17681/ ✔️

@Trott
Copy link
Member Author

Trott commented Oct 9, 2018

/ping @nodejs/assert @nodejs/testing This needs one more review.

Trott added a commit to Trott/io.js that referenced this pull request Oct 9, 2018
The internal `assert` modules `errorCache` property is exposed only for
testing. The one test that used it is rewritten here to not use it.

This has the following advantages:

* The test now makes sure that there is an empty cache in a more robust
  way. Instead of relying on the internal implementation of
  `errorCache`, it simply spawns a separate process.
* One less test using the `--expose-internals` flag.

PR-URL: nodejs#23304
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Trott added a commit to Trott/io.js that referenced this pull request Oct 9, 2018
The internal assert module exposed an errorCache property solely for
testing. It is no longer necessary. Remove it.

PR-URL: nodejs#23304
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
@Trott
Copy link
Member Author

Trott commented Oct 9, 2018

Landed in 157d507...4d58c08

@Trott Trott closed this Oct 9, 2018
targos pushed a commit that referenced this pull request Oct 10, 2018
The internal `assert` modules `errorCache` property is exposed only for
testing. The one test that used it is rewritten here to not use it.

This has the following advantages:

* The test now makes sure that there is an empty cache in a more robust
  way. Instead of relying on the internal implementation of
  `errorCache`, it simply spawns a separate process.
* One less test using the `--expose-internals` flag.

PR-URL: #23304
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
targos pushed a commit that referenced this pull request Oct 10, 2018
The internal assert module exposed an errorCache property solely for
testing. It is no longer necessary. Remove it.

PR-URL: #23304
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
sagitsofan pushed a commit to sagitsofan/node that referenced this pull request Oct 12, 2018
The internal `assert` modules `errorCache` property is exposed only for
testing. The one test that used it is rewritten here to not use it.

This has the following advantages:

* The test now makes sure that there is an empty cache in a more robust
  way. Instead of relying on the internal implementation of
  `errorCache`, it simply spawns a separate process.
* One less test using the `--expose-internals` flag.

PR-URL: nodejs#23304
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
sagitsofan pushed a commit to sagitsofan/node that referenced this pull request Oct 12, 2018
The internal assert module exposed an errorCache property solely for
testing. It is no longer necessary. Remove it.

PR-URL: nodejs#23304
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
jasnell pushed a commit that referenced this pull request Oct 17, 2018
The internal `assert` modules `errorCache` property is exposed only for
testing. The one test that used it is rewritten here to not use it.

This has the following advantages:

* The test now makes sure that there is an empty cache in a more robust
  way. Instead of relying on the internal implementation of
  `errorCache`, it simply spawns a separate process.
* One less test using the `--expose-internals` flag.

PR-URL: #23304
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
jasnell pushed a commit that referenced this pull request Oct 17, 2018
The internal assert module exposed an errorCache property solely for
testing. It is no longer necessary. Remove it.

PR-URL: #23304
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
@Trott Trott deleted the vancouver-03 branch January 13, 2022 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assert Issues and PRs related to the assert subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants