You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Terje Strand (Jira)" <ji...@apache.org> on 2020/07/25 07:13:00 UTC

[jira] [Commented] (SUREFIRE-1744) Enable system-out for successfuly passed tests as well

    [ https://issues.apache.org/jira/browse/SUREFIRE-1744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17164795#comment-17164795 ] 

Terje Strand commented on SUREFIRE-1744:
----------------------------------------

The fix for this bug is causing us issues. We have some tests that generate a lot of output, and we therefore use the setting 'redirectTestOutputToFile' to put the output of successful cases in a separate file.

However, the change here causes all xml files to become huge, and our total xml output is now 500mb.

Why was this approach chosen rather than using the existing parameter? Also, this system-out setting must be configurable. Right now we are getting the output of successful tests in _both_ the xml file and output file.

> Enable system-out for successfuly passed tests as well
> ------------------------------------------------------
>
>                 Key: SUREFIRE-1744
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1744
>             Project: Maven Surefire
>          Issue Type: New Feature
>          Components: Maven Surefire Plugin
>            Reporter: Klevis Ramo
>            Assignee: Tibor Digana
>            Priority: Major
>             Fix For: 3.0.0-M5
>
>         Attachments: image-2020-01-09-16-03-07-261.png, image-2020-01-09-16-04-11-142.png
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> *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*) :
> {code:java}
> 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();
>     }
> }{code}
> *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.
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)