Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1992

Increase output length of test errors/failures in summary

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 3.0.0-M6
    • None
    • None

    Description

      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 JUnit test:

      class FailingTest {
          @Test
          void throwsRTException() {
              throw new RuntimeException("123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.");
          }
      } 
      

      results in following output:

      [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

      The abbreviation is done in class SmartStackTraceParser (and/or LegacyPojoStackTraceWriter). Both have:

      MAX_LINE_LENGTH = 77

      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.

      Attachments

        Activity

          People

            tibordigana Tibor Digana
            spannjp Markus Spann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: