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: simplify test-worker-syntax-error #26144

Closed
wants to merge 1 commit into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Feb 16, 2019

Remove extraneous code from test-worker-syntax-error. Because the worker
is called with eval: true, there is no need to set an environment
variable indicating whether the worker has started and so on. The test
file is only ever executed by the main thread.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Remove extraneous code from test-worker-syntax-error. Because the worker
is called with `eval: true`, there is no need to set an environment
variable indicating whether the worker has started and so on. The test
file is only ever executed by the main thread.
@Trott Trott requested a review from addaleax February 16, 2019 06:10
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Feb 16, 2019
@Trott
Copy link
Member Author

Trott commented Feb 16, 2019

@ChALkeR
Copy link
Member

ChALkeR commented Feb 16, 2019

there is no need to set an environment variable indicating whether the worker has started and so on

Given that the else path throws an error, wasn't this a test for that?

Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

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

Thank you :)

@addaleax
Copy link
Member

@ChALkeR I think that was just a pattern that I accidentally copied from another test file :)

@Trott
Copy link
Member Author

Trott commented Feb 16, 2019

Given that the else path throws an error, wasn't this a test for that?

@ChALkeR The else branch is effectively unreachable and does not appear to be part of the test. In other tests, we might do something like that because the workers use the test code. In this test, the worker is using eval to run the code in a string. (The string contains a syntax error, and that error is indeed part of the test.)

@Trott
Copy link
Member Author

Trott commented Feb 16, 2019

Resume Build CI: https://ci.nodejs.org/job/node-test-pull-request/20812/

@Trott Trott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 16, 2019
@addaleax addaleax added the worker Issues and PRs related to Worker support. label Feb 18, 2019
@addaleax
Copy link
Member

Landed in 584dc48

@addaleax addaleax closed this Feb 18, 2019
addaleax pushed a commit that referenced this pull request Feb 18, 2019
Remove extraneous code from test-worker-syntax-error. Because the worker
is called with `eval: true`, there is no need to set an environment
variable indicating whether the worker has started and so on. The test
file is only ever executed by the main thread.

PR-URL: #26144
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
addaleax pushed a commit that referenced this pull request Feb 18, 2019
Remove extraneous code from test-worker-syntax-error. Because the worker
is called with `eval: true`, there is no need to set an environment
variable indicating whether the worker has started and so on. The test
file is only ever executed by the main thread.

PR-URL: #26144
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@BridgeAR BridgeAR mentioned this pull request Feb 26, 2019
rvagg pushed a commit that referenced this pull request Feb 28, 2019
Remove extraneous code from test-worker-syntax-error. Because the worker
is called with `eval: true`, there is no need to set an environment
variable indicating whether the worker has started and so on. The test
file is only ever executed by the main thread.

PR-URL: #26144
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@Trott Trott deleted the simplify-worker-test branch January 13, 2022 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. test Issues and PRs related to the tests. worker Issues and PRs related to Worker support.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants