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

Enable system-out for successfuly passed tests as well

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0-M5
    • Component/s: Maven Surefire Plugin
    • Labels:
      None

      Description

      Situation

      Currently logs during tests execution are exported to *.xml report only for failed tests.

      The xsd schema also implies the same(surefire-test-report-3.0.xsd,legacy-surefire-test-report.xsd) , system-out elment is always a child of failure,rerunFailure,flakyFailure,rerunError or flakyError element.

      Some part of the code(createOutErrElements adds the system-out) :

      StatelessXmlReporter
       
      private void serializeTestClassWithoutRerun( OutputStream outputStream, OutputStreamWriter fw, XMLWriter ppw,
                                                   List<WrappedReportEntry> methodEntries )
      {
          for ( WrappedReportEntry methodEntry : methodEntries )
          {
              startTestElement( ppw, methodEntry );
              if ( methodEntry.getReportEntryType() != SUCCESS )
              {
                  getTestProblems( fw, ppw, methodEntry, trimStackTrace, outputStream,
                          methodEntry.getReportEntryType().getXmlTag(), false );
                  createOutErrElements( fw, ppw, methodEntry, outputStream );
              }
              ppw.endElement();
          }
      }

      Problem

      Because logs are not exported for successfully tests there is no way(outside IDE or complete log) one could nicely explore what a particular test is doing. This is hurting also the documentation part of a test.Imagine those tests are used as end to end tests and business analysts would like to review through CI tools like jenkins.

       

      Possible Solution

      Enable maven sure fire plugin to export logs to system-out also for succefully passed tests through an optional parameter leaving the default behaviour as it is right now(only failed tests have outputs exported). This means of course also enchancing the xsd to support system-out to different parent rather then only failed ones.

       

      Since it happens I am also a developer I can of course help with the feature implementation if you find this something that makes sense.

       

       

        Attachments

        1. image-2020-01-09-16-03-07-261.png
          515 kB
          Klevis Ramo
        2. image-2020-01-09-16-04-11-142.png
          109 kB
          Klevis Ramo

          Issue Links

            Activity

              People

              • Assignee:
                tibordigana Tibor Digana
                Reporter:
                ramok Klevis Ramo
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m