Skip to content

test: simplify test-worker-syntax-error - #26144

Closed
Trott wants to merge 1 commit into
nodejs:masterfrom
Trott:simplify-worker-test
Closed

test: simplify test-worker-syntax-error#26144
Trott wants to merge 1 commit into
nodejs:masterfrom
Trott:simplify-worker-test

Conversation

@Trott

Copy link
Copy Markdown
Member

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 addaleaxFebruary 16, 2019 06:10
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-botnodejs-github-bot added the test Issues and PRs related to the tests. label Feb 16, 2019
@Trott

Copy link
Copy Markdown
MemberAuthor

@ChALkeR

ChALkeR commented Feb 16, 2019

Copy link
Copy Markdown
Member

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?

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

Thank you :)

@addaleax

Copy link
Copy Markdown
Member

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

@Trott

Copy link
Copy Markdown
MemberAuthor

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

Trott commented Feb 16, 2019

Copy link
Copy Markdown
MemberAuthor

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

Copy link
Copy Markdown
Member

Landed in 584dc48

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>
@BridgeARBridgeAR 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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.testIssues and PRs related to the tests.workerIssues and PRs related to Worker support.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@Trott@nodejs-github-bot@ChALkeR@addaleax@cjihrig@richardlau