-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: incorrect unwrapping of errors in after() when using the tap reporter #48941
Labels
confirmed-bug
Issues with confirmed bugs.
test_runner
Issues and PRs related to the test runner subsystem.
Comments
mcollina
added
confirmed-bug
Issues with confirmed bugs.
test_runner
Issues and PRs related to the test runner subsystem.
labels
Jul 27, 2023
mcollina
changed the title
test: wrong unwrapping of errors in after() when using the --test flag
test_runner: wrong unwrapping of errors in after() when using the --test flag
Jul 27, 2023
mcollina
changed the title
test_runner: wrong unwrapping of errors in after() when using the --test flag
test_runner: incorrect unwrapping of errors in after() when using the --test flag
Jul 27, 2023
Closing. I was using v18.16.1 and in v18.17.0 is fixed. |
Actually it's a problem, updating the report. |
This appears to be a bug with the TAP reporter. |
mcollina
changed the title
test_runner: incorrect unwrapping of errors in after() when using the --test flag
test_runner: incorrect unwrapping of errors in after() when using the tap reporter
Jul 27, 2023
This seems to fix it: diff --git a/lib/internal/test_runner/reporter/tap.js b/lib/internal/test_runner/reporter/tap.js
index 4aec4ba072..e22c647669 100644
--- a/lib/internal/test_runner/reporter/tap.js
+++ b/lib/internal/test_runner/reporter/tap.js
@@ -198,15 +198,14 @@ function jsToYaml(indent, name, value, seen) {
errStack = cause?.stack ?? errStack;
errCode = cause?.code ?? errCode;
errName = cause?.name ?? errName;
+ errMsg = cause?.message ?? errMsg;
+
if (isAssertionLike(cause)) {
errExpected = cause.expected;
errActual = cause.actual;
errOperator = cause.operator ?? errOperator;
errIsAssertion = true;
}
- if (failureType === kTestCodeFailure) {
- errMsg = cause?.message ?? errMsg;
- }
}
result += jsToYaml(indent, 'error', errMsg, seen); |
cjihrig
added a commit
to cjihrig/node
that referenced
this issue
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: nodejs#48941
Proposed fix in #48942 |
nodejs-github-bot
pushed a commit
that referenced
this issue
Jul 29, 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>
pluris
pushed a commit
to pluris/node
that referenced
this issue
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 issue
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 issue
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 issue
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 issue
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 issue
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>
RafaelGSS
pushed a commit
to RafaelGSS/node
that referenced
this issue
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 issue
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 issue
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 issue
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 issue
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
confirmed-bug
Issues with confirmed bugs.
test_runner
Issues and PRs related to the test runner subsystem.
Consider this test:
If I run it normally, I get:
If I run in a non-interactive process such as
node --test bug.js | less
, I get the error detail scrambled:This shows specifically during CI runs, where the pretty reporter is not engaged.
The text was updated successfully, but these errors were encountered: