papegaaij commented on pull request #389:
URL: https://github.com/apache/maven-surefire/pull/389#issuecomment-1016426984


   The `LauncherSession` is explicitly meant to provide a state over all tests. 
It is completely separate from `Extension`. This patch will only effect 
projects that already use these `LauncherSessions`. For that, they have to 
implement `LauncherSessionListener` and put the classname in a service file for 
the `ServiceLoader` to pick it up. If a project makes use of 
`LauncherSessionListener`, they will, without this patch, see a new session 
being started for every test, which actually is incorrect behavior. The javadoc 
on `LauncherSession` explains this: `The LauncherSession API is the main entry 
point for client code that wishes to repeatedly discover and execute tests 
using one or more test engines.` This is exactly what Surefire does, hence it 
should use `LauncherSession` to do this.
   
   What a user does with a `LauncherSessionListener` implementation is up to 
the user. The javadoc does not give any guidelines. The Gradle documentation 
actually points to this interface for once-per-vm setup and teardown: 
https://docs.gradle.com/enterprise/test-distribution-gradle-plugin/#junit_5_8_and_later


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