Tibor17 commented on pull request #348:
URL: https://github.com/apache/maven-surefire/pull/348#issuecomment-1022720153


   The `TestListResolver` does not do the trick. It is only a filter. You 
should not use it.
   The whole trick is done in every Surefire Provider implementation. So in 
this case, you have to modify the providers.
   I think this snap code explains how we do it, see the `JUnit4Provider`:
   ```
       private TestsToRun scanClassPath()
       {
           final TestsToRun scannedClasses = scanResult.applyFilter( 
jUnit4TestChecker, testClassLoader );
           return runOrderCalculator.orderTestClasses( scannedClasses );
       }
   ```
   The problem is that we do not work with methods. Only classes.
   And we should remember JUnit5 because it know scripts, dynamic tests, etc.
   
   So all you have to do is to serialize run order (enum + data), see 
`BooterSerializer` and deserialize it via `BooterDeserializer`.
   It means that you have transfered the config for `RunOrderCalculator` fom 
plugin JVM to the forked JVM. Similar serialization trick in the in-plugin JVM.
   Then you should obtain the instance of `RunOrderCalculator` in the 
particular provider. The next step is to modify the section I mentioned above 
which would include the methods as well.
   
   The system property and TestListResolver parts can be avoided.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to