Skip to content

test_runner: fix afterEach not running on test failures - #45204

Merged
nodejs-github-bot merged 5 commits into
nodejs:mainfrom
MrJithil:fix-45192
Nov 7, 2022
Merged

test_runner: fix afterEach not running on test failures#45204
nodejs-github-bot merged 5 commits into
nodejs:mainfrom
MrJithil:fix-45192

Conversation

@MrJithil

@MrJithil MrJithil commented Oct 27, 2022

Copy link
Copy Markdown
Member

test_runner: fix afterEach not running on test failures

Fixes: #45192

@nodejs-github-bot nodejs-github-bot added dont-land-on-v14.x needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Oct 27, 2022

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

In general LGTM, a few comments:

@MrJithil

MrJithil commented Oct 27, 2022

Copy link
Copy Markdown
Member Author

In general LGTM, a few comments:

Could you please provide a test snippet or some more details?

@MoLow

MoLow commented Oct 27, 2022

Copy link
Copy Markdown
Member

Could you please provide a test snippet or some more details?

checkout the failing tests

@MrJithil

Copy link
Copy Markdown
Member Author

Working on it.

@MrJithil

MrJithil commented Nov 5, 2022

Copy link
Copy Markdown
Member Author

help needed to fix the test case. I can see the test file is failing with the latest release as well.

I am confused, how to clean up or adjust the test case. Please provide some samples or feel free to commit to the PR.

@MoLow

MoLow commented Nov 5, 2022

Copy link
Copy Markdown
Member

@MrJithil I took a look.
prior to this PR, tests was marked as passed only in case the afterEach hook passed, https://github.com/nodejs/node/blob/789b7eebff58d404ac8f060376a75e26b514f9af/lib/internal/test_runner/test.js#L521
after this PR, if the afterEach hook failed there is no indication besides the parent test failing:
see the output for these tests:
https://github.com/nodejs/node/blob/789b7eebff58d404ac8f060376a75e26b514f9af/test/message/test_runner_hooks.js#L73-L77
image

@MoLow

MoLow commented Nov 5, 2022

Copy link
Copy Markdown
Member

@MrJithil I pushed a fix;
@nodejs/test_runner I would appreciate a review

@MoLow MoLow added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 5, 2022
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 5, 2022
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Comment thread lib/internal/test_runner/test.js Outdated
Comment thread lib/internal/test_runner/test.js Outdated
Comment thread lib/internal/test_runner/test.js Outdated
@MoLow MoLow added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 6, 2022
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 6, 2022
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@MoLow

MoLow commented Nov 6, 2022

Copy link
Copy Markdown
Member

Do we need the out files?

yeah, tools/test.py compares the output with the actual result

@MoLow MoLow added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Nov 6, 2022
@MrJithil

MrJithil commented Nov 6, 2022

Copy link
Copy Markdown
Member Author

@MrJithil I pushed a fix;
@nodejs/test_runner I would appreciate a review

Thank you so much for the help and it's a really great work. Do we need the out files?

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Comment thread lib/internal/test_runner/test.js Outdated
MrJithil and others added 5 commits November 6, 2022 22:30
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@MoLow MoLow added the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 7, 2022
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Nov 7, 2022
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/45204
✔  Done loading data for nodejs/node/pull/45204
----------------------------------- PR info ------------------------------------
Title      test_runner: fix afterEach not running on test failures (#45204)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     MrJithil:fix-45192 -> nodejs:main
Labels     needs-ci, dont-land-on-v14.x, commit-queue-squash, test_runner
Commits    5
 - test_runner: fix afterEach not running on test failures
 - fix
 - CR
 - CR
 - CR
Committers 1
 - Moshe Atlow 
PR-URL: https://github.com/nodejs/node/pull/45204
Fixes: https://github.com/nodejs/node/issues/45192
Reviewed-By: Benjamin Gruenbaum 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/45204
Fixes: https://github.com/nodejs/node/issues/45192
Reviewed-By: Benjamin Gruenbaum 
--------------------------------------------------------------------------------
   ⚠  Commits were pushed since the last review:
   ⚠  - test_runner: fix afterEach not running on test failures
   ⚠  - fix
   ⚠  - CR
   ⚠  - CR
   ⚠  - CR
   ℹ  This PR was created on Thu, 27 Oct 2022 09:31:19 GMT
   ✔  Approvals: 1
   ✔  - Benjamin Gruenbaum (@benjamingr): https://github.com/nodejs/node/pull/45204#pullrequestreview-1169503033
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2022-11-07T03:50:10Z: https://ci.nodejs.org/job/node-test-pull-request/47755/
- Querying data for job/node-test-pull-request/47755/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/3407846700

@MoLow MoLow added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Nov 7, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 7, 2022
@nodejs-github-bot
nodejs-github-bot merged commit 3759935 into nodejs:main Nov 7, 2022
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 3759935

RafaelGSS pushed a commit that referenced this pull request Nov 10, 2022
test_runner: fix afterEach not running on test failures

PR-URL: #45204
Fixes: #45192
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
@RafaelGSS RafaelGSS mentioned this pull request Nov 10, 2022
MoLow pushed a commit to MoLow/node that referenced this pull request Dec 9, 2022
test_runner: fix afterEach not running on test failures

PR-URL: nodejs#45204
Fixes: nodejs#45192
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
danielleadams pushed a commit that referenced this pull request Dec 30, 2022
test_runner: fix afterEach not running on test failures

PR-URL: #45204
Fixes: #45192
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
danielleadams pushed a commit that referenced this pull request Jan 3, 2023
test_runner: fix afterEach not running on test failures

PR-URL: #45204
Fixes: #45192
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
MoLow pushed a commit to MoLow/node-core-test that referenced this pull request Feb 2, 2023
test_runner: fix afterEach not running on test failures

PR-URL: nodejs/node#45204
Fixes: nodejs/node#45192
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
(cherry picked from commit 3759935ee29d8042d917d3ceaa768521c14413ff)
MoLow pushed a commit to MoLow/node-core-test that referenced this pull request Feb 2, 2023
PR-URL: nodejs/node#45204
Fixes: nodejs/node#45192
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
(cherry picked from commit 3759935ee29d8042d917d3ceaa768521c14413ff)
MoLow pushed a commit to MoLow/node-core-test that referenced this pull request Feb 2, 2023
PR-URL: nodejs/node#45204
Fixes: nodejs/node#45192
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
(cherry picked from commit 3759935ee29d8042d917d3ceaa768521c14413ff)
MoLow pushed a commit to MoLow/node-core-test that referenced this pull request Feb 2, 2023
PR-URL: nodejs/node#45204
Fixes: nodejs/node#45192
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
(cherry picked from commit 3759935ee29d8042d917d3ceaa768521c14413ff)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

afterEach hook not executed when test fails

6 participants