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_runner: unwrap error message in TAP reporter #48942

Merged
merged 2 commits into from
Jul 29, 2023

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Jul 27, 2023

The TAP reporter unwraps errors that come from user code. It was not properly unwrapping the error message when the failure originated from a test hook. This lead to difficult to debug errors when TAP output was used. This commit updates the TAP reporter to properly unwrap the error message.

Fixes: #48941

The TAP reporter unwraps errors that come from user code. It
was not properly unwrapping the error message when the failure
originated from a test hook. This lead to difficult to debug
errors when TAP output was used. This commit updates the TAP
reporter to properly unwrap the error message.

Fixes: nodejs#48941
@cjihrig cjihrig requested a review from mcollina July 27, 2023 16:06
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Jul 27, 2023
@@ -56,7 +56,7 @@ not ok 2 - before throws
duration_ms: *
type: 'suite'
failureType: 'hookFailed'
error: 'failed running before hook'
error: 'before'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If it looks like these error messages are actually less helpful - these are the actual message from the error objects thrown in the test.

Copy link
Member

Choose a reason for hiding this comment

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

@cjihrig and why is there no stack? 😅

Copy link
Member

@atlowChemi atlowChemi Jul 27, 2023

Choose a reason for hiding this comment

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

Is that just the snapshot behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Check out lines 61 and 62 (in the TAP reporter, the error is serialized to YAML, not a nice to read error like the spec reporter)

Copy link
Member

@MoLow MoLow left a comment

Choose a reason for hiding this comment

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

nice

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 28, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 28, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@cjihrig cjihrig added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed needs-ci PRs that need a full CI run. labels Jul 29, 2023
@MoLow MoLow added the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 29, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 29, 2023
@nodejs-github-bot nodejs-github-bot merged commit bef3942 into nodejs:main Jul 29, 2023
33 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in bef3942

pluris pushed a commit to pluris/node that referenced this pull request Aug 6, 2023
The TAP reporter unwraps errors that come from user code. It
was not properly unwrapping the error message when the failure
originated from a test hook. This lead to difficult to debug
errors when TAP output was used. This commit updates the TAP
reporter to properly unwrap the error message.

Fixes: nodejs#48941
PR-URL: nodejs#48942
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
pluris pushed a commit to pluris/node that referenced this pull request Aug 7, 2023
The TAP reporter unwraps errors that come from user code. It
was not properly unwrapping the error message when the failure
originated from a test hook. This lead to difficult to debug
errors when TAP output was used. This commit updates the TAP
reporter to properly unwrap the error message.

Fixes: nodejs#48941
PR-URL: nodejs#48942
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
The TAP reporter unwraps errors that come from user code. It
was not properly unwrapping the error message when the failure
originated from a test hook. This lead to difficult to debug
errors when TAP output was used. This commit updates the TAP
reporter to properly unwrap the error message.

Fixes: nodejs#48941
PR-URL: nodejs#48942
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
The TAP reporter unwraps errors that come from user code. It
was not properly unwrapping the error message when the failure
originated from a test hook. This lead to difficult to debug
errors when TAP output was used. This commit updates the TAP
reporter to properly unwrap the error message.

Fixes: nodejs#48941
PR-URL: nodejs#48942
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
UlisesGascon pushed a commit to UlisesGascon/node that referenced this pull request Aug 14, 2023
The TAP reporter unwraps errors that come from user code. It
was not properly unwrapping the error message when the failure
originated from a test hook. This lead to difficult to debug
errors when TAP output was used. This commit updates the TAP
reporter to properly unwrap the error message.

Fixes: nodejs#48941
PR-URL: nodejs#48942
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
RafaelGSS pushed a commit that referenced this pull request Aug 15, 2023
The TAP reporter unwraps errors that come from user code. It
was not properly unwrapping the error message when the failure
originated from a test hook. This lead to difficult to debug
errors when TAP output was used. This commit updates the TAP
reporter to properly unwrap the error message.

Fixes: #48941
PR-URL: #48942
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
@UlisesGascon UlisesGascon mentioned this pull request Aug 15, 2023
RafaelGSS pushed a commit to RafaelGSS/node that referenced this pull request Aug 15, 2023
The TAP reporter unwraps errors that come from user code. It
was not properly unwrapping the error message when the failure
originated from a test hook. This lead to difficult to debug
errors when TAP output was used. This commit updates the TAP
reporter to properly unwrap the error message.

Fixes: nodejs#48941
PR-URL: nodejs#48942
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
RafaelGSS pushed a commit that referenced this pull request Aug 17, 2023
The TAP reporter unwraps errors that come from user code. It
was not properly unwrapping the error message when the failure
originated from a test hook. This lead to difficult to debug
errors when TAP output was used. This commit updates the TAP
reporter to properly unwrap the error message.

Fixes: #48941
PR-URL: #48942
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
targos pushed a commit that referenced this pull request Nov 27, 2023
The TAP reporter unwraps errors that come from user code. It
was not properly unwrapping the error message when the failure
originated from a test hook. This lead to difficult to debug
errors when TAP output was used. This commit updates the TAP
reporter to properly unwrap the error message.

Fixes: #48941
PR-URL: #48942
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
sercher added a commit to sercher/graaljs that referenced this pull request Apr 25, 2024
The TAP reporter unwraps errors that come from user code. It
was not properly unwrapping the error message when the failure
originated from a test hook. This lead to difficult to debug
errors when TAP output was used. This commit updates the TAP
reporter to properly unwrap the error message.

Fixes: nodejs/node#48941
PR-URL: nodejs/node#48942
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
sercher added a commit to sercher/graaljs that referenced this pull request Apr 25, 2024
The TAP reporter unwraps errors that come from user code. It
was not properly unwrapping the error message when the failure
originated from a test hook. This lead to difficult to debug
errors when TAP output was used. This commit updates the TAP
reporter to properly unwrap the error message.

Fixes: nodejs/node#48941
PR-URL: nodejs/node#48942
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
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. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. test_runner Issues and PRs related to the test runner subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test_runner: incorrect unwrapping of errors in after() when using the tap reporter
6 participants