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_r289633174
##########
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(
Review comment:
This is crucial place. Without showing the seed to user, by default, this PR
have no sense. It must be presented to user be able to reproduce the same exact
run.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services