You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Markus Spann (Jira)" <ji...@apache.org> on 2022/01/28 07:59:00 UTC
[jira] [Created] (SUREFIRE-1992) Increase output length of test errors/failures in summary
Markus Spann created SUREFIRE-1992:
--------------------------------------
Summary: Increase output length of test errors/failures in summary
Key: SUREFIRE-1992
URL: https://issues.apache.org/jira/browse/SUREFIRE-1992
Project: Maven Surefire
Issue Type: Task
Reporter: Markus Spann
A {{StackTraceWriter}} writes test failures and errors to stderr. The output is abbreviated to 78 characters and suffixed by three dots. It is often difficult if not impossible to quickly understand the test failure due to this abbreviation.
This JUnit5 test:
{code:java}
class FailingTest {
@Test
void throwsRTException() {
throw new RuntimeException("123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.");
}
}
{code}
results in this output:
{code:java}
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] FailingTest.throwsRTException:12 Runtime 123456789.123456789.123456789.1234567...
[INFO]
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0{code}
The abbreviation is done in class {{SmartStackTraceParser}} (and/or {{{}LegacyPojoStackTraceWriter{}}}). Both have:
{code:java}
MAX_LINE_LENGTH = 77{code}
The actual output is 78 characters long ;)
This behavior is true for all errors/failures except:
AssertionError, AssertionFailedError, ComparisonFailure and org.opentest4j.*
Why these should receive special treatment is not obvious.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)