cardil commented on a change in pull request #112: Adding support for externally passed random seed and printing used seed on console URL: https://github.com/apache/maven-surefire/pull/112#discussion_r289633130
########## File path: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java ########## @@ -181,6 +183,30 @@ public void runStarting() log( "-------------------------------------------------------" ); log( " T E S T S" ); log( "-------------------------------------------------------" ); + displayRandomization(); + } + } + + private boolean isRandomized() + { + return reportConfiguration.getRunOrderParameters() != null + && reportConfiguration.getRunOrderParameters().isRandomized(); + } + + private void displayRandomization() + { + if ( isRandomized() ) + { + final Randomizer randomizer = reportConfiguration.getRunOrderParameters().getRandomizer(); + final String pluginName = reportConfiguration.getPluginName(); + + log( "" ); + log( String.format( + "Tests are randomly ordered. Re-run the same execution order" + + " with -D%s.runOrder=random:%d", + pluginName, randomizer.getSeed() + ) ); + log( "" ); Review comment: This is "\n", just like the code in `runCompleted()` (just beneath) that existed before. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services