Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-5949

Trim JUnit stack traces & logs to reasonable length before mailing

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      $FAILED_TESTS includes full stdout/stderr of tests and stack traces. If you are using something like

      http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-nbjunit/org/netbeans/junit/NbTestCase.html#logLevel%28%29

      these can be quite large. Furthermore, sometimes complete text of a log session is packed into a single line of text (no internal newlines), and when replying to such a message, Thunderbird has extremely poor performance.

      Better to truncate all this to some reasonable maximum sizes, as we do for e.g. console logs; the user can always click the hyperlink to the build's test cases to see details.

        Attachments

          Activity

          Hide
          slide_o_mix Alex Earl added a comment -

          FAILED_TESTS does have the maxTests parameter that can be used to truncate the number of tests that will be shown.

          Show
          slide_o_mix Alex Earl added a comment - FAILED_TESTS does have the maxTests parameter that can be used to truncate the number of tests that will be shown.
          Hide
          jglick Jesse Glick added a comment -

          That does not help if you have just one or two failed tests but each has a huge volume of log output.

          Show
          jglick Jesse Glick added a comment - That does not help if you have just one or two failed tests but each has a huge volume of log output.
          Hide
          slide_o_mix Alex Earl added a comment -

          What would you consider a "reasonable maximum size"?

          Show
          slide_o_mix Alex Earl added a comment - What would you consider a "reasonable maximum size"?
          Hide
          jglick Jesse Glick added a comment -

          Well MailSender.MAX_LOG_LINES defaults to 250 lines, though even this would not help for a single very long line. Off the cuff I would say 50Kb is probably more test detail than you would want to get in a mail message, but it would require some experimentation to see how much that looks like—a few screenfuls in a typical mail reader at a typical screen resolution?

          Show
          jglick Jesse Glick added a comment - Well MailSender.MAX_LOG_LINES defaults to 250 lines, though even this would not help for a single very long line. Off the cuff I would say 50Kb is probably more test detail than you would want to get in a mail message, but it would require some experimentation to see how much that looks like—a few screenfuls in a typical mail reader at a typical screen resolution?
          Hide
          slide_o_mix Alex Earl added a comment -

          The way I have implemented this is with a new parameter (maxLength) which can be used to specify the max KB of data to print as part of the FAILED_TESTS token. If the output would exceed the amount specified, then it truncates the output and adds "...output truncated" to the output. The default value of the parameter imposes no limit to maintain current functionality by default. Will this meet the request?

          Show
          slide_o_mix Alex Earl added a comment - The way I have implemented this is with a new parameter (maxLength) which can be used to specify the max KB of data to print as part of the FAILED_TESTS token. If the output would exceed the amount specified, then it truncates the output and adds "...output truncated" to the output. The default value of the parameter imposes no limit to maintain current functionality by default. Will this meet the request?
          Hide
          jglick Jesse Glick added a comment -

          Makes sense I think.

          Show
          jglick Jesse Glick added a comment - Makes sense I think.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Alex Earl
          Path:
          src/main/java/hudson/plugins/emailext/plugins/content/FailedTestsContent.java
          src/test/java/hudson/plugins/emailext/plugins/content/FailedTestsContentTest.java
          http://jenkins-ci.org/commit/email-ext-plugin/4a441eba86eebb5c96ca4dacfb2b3e53e8f12ec2
          Log:
          Merge branch 'JENKINS-5949'

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Alex Earl Path: src/main/java/hudson/plugins/emailext/plugins/content/FailedTestsContent.java src/test/java/hudson/plugins/emailext/plugins/content/FailedTestsContentTest.java http://jenkins-ci.org/commit/email-ext-plugin/4a441eba86eebb5c96ca4dacfb2b3e53e8f12ec2 Log: Merge branch ' JENKINS-5949 '

            People

            • Assignee:
              slide_o_mix Alex Earl
              Reporter:
              jglick Jesse Glick
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: