-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce LauncherInterceptor
API
#3091
Conversation
f75a2a7
to
4f56612
Compare
Nice work, Marc! Will take a closer look later this week. I already see a way to supersed this project, or at least make sormuras/junit-platform-isolator use this new feature. 🤔 |
ea04536
to
5614e89
Compare
Interesting! I'm guessing this feature could also be used to run logic that needs to run only once per test suite invocation? |
Yes, but |
d7c2980
to
95f3925
Compare
95f3925
to
880fc6f
Compare
880fc6f
to
4af316e
Compare
So they can influence the class loader used to load test engines etc.
- Avoid early static initialization during native image compilation where possible - Use and document `--initialize-at-build-time` build argument
4af316e
to
da8e76f
Compare
da8e76f
to
5f925ce
Compare
LauncherInterceptor
API
Hi @marcphilipp, thanks for this. I'm having a play with the new capability for the Quarkus use case (as discussed in #2579 and #3028). Using sophisticated debug (system out printlns), I can see that the launcher interceptor is being invoked, and is calling I have an extension which implements Am I doing something wrong, or was I just over-optimistic about how much would be changed by doing an interception? I do hope it's "I am doing something wrong," because we've been quite excited about in the Quarkus team about how this would allow us to eliminate some classloader hacks. (We're already able to run the test class itself from a different classloader with the existing interceptors, just by making a new instance with |
Actually, it's an |
Overview
In order to support use cases where test discovery and execution needs to be wrapped by third-party code, e.g. for using the Eclipse OSGi runtime this PR introduces
LauncherInterceptor
which can be registered using Java's ServiceLoader mechanism. The feature is opt-in via a new configuration parameter than can be set as a system property in order to avoid accidental usage via transitive dependencies.I hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done
@API
annotations