Skip to content

test_runner: fix global after hook - #48231

Merged
nodejs-github-bot merged 3 commits into
nodejs:mainfrom
MoLow:fix-global-after
May 31, 2023
Merged

test_runner: fix global after hook#48231
nodejs-github-bot merged 3 commits into
nodejs:mainfrom
MoLow:fix-global-after

Conversation

@MoLow

@MoLowMoLow commented May 28, 2023

Copy link
Copy Markdown
Member

Fixes: #48230

@MoLow
MoLow requested a review from cjihrigMay 28, 2023 14:52
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels May 28, 2023
Comment threadlib/internal/test_runner/test.js
Comment threadlib/internal/test_runner/harness.js Outdated
Comment threadlib/internal/test_runner/test.js
@MoLow

Copy link
Copy Markdown
MemberAuthor

@cjihrig I just pushed a fix making root test use run and this way it gets all the logic and hooks included inside run OOTB.
this meant I had to adjust run to be 100% synchronous in cases we use it for the root test

Comment threadlib/internal/test_runner/test.js Outdated
@MoLow
MoLow requested a review from cjihrigMay 30, 2023 20:02

@cjihrigcjihrig left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this meant I had to adjust run to be 100% synchronous in cases we use it for the root test

run() can't be 100% synchronous - it's an async function.

I guess there are no implications since the tests seem to pass, but don't we call root.postRun() in runner.js? Should we be calling root.run() there instead now?

Comment threadlib/internal/test_runner/harness.js
Comment threadlib/internal/test_runner/test.js Outdated
Comment threadlib/internal/test_runner/test.js Outdated
Comment threadlib/internal/test_runner/test.js Outdated
@MoLow

Copy link
Copy Markdown
MemberAuthor

but don't we call root.postRun() in runner.js? Should we be calling root.run() there instead now?

well in runner.js we run test files only, and we use a root that is not global (created using createTestTree), so there is no need to use run since it is impossible to set hooks or anything else that run handles

@MoLowMoLow added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels May 31, 2023
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 31, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@MoLowMoLow added the commit-queue Add this label to land a pull request using GitHub Actions. label May 31, 2023
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label May 31, 2023
@nodejs-github-bot
nodejs-github-bot merged commit 5e98a74 into nodejs:mainMay 31, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 5e98a74

@MoLow
MoLow deleted the fix-global-after branch May 31, 2023 15:33
targos pushed a commit that referenced this pull request Jun 4, 2023
PR-URL: #48231Fixes: #48230
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@targostargos mentioned this pull request Jun 4, 2023
danielleadams pushed a commit that referenced this pull request Jul 6, 2023
PR-URL: #48231Fixes: #48230
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MoLow added a commit to MoLow/node that referenced this pull request Jul 6, 2023
PR-URL: nodejs#48231Fixes: nodejs#48230
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
PR-URL: nodejs#48231Fixes: nodejs#48230
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
PR-URL: nodejs#48231Fixes: nodejs#48230
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
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.commit-queue-squashAdd this label to instruct the Commit Queue to squash all the PR commits into the first one.needs-ciPRs that need a full CI run.test_runnerIssues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test-runner: global after not working

5 participants

@MoLow@nodejs-github-bot@benjamingr@cjihrig@atlowChemi