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
[SUREFIRE-1935] Upgrade to JUnit Platform 1.8, start Launcher via LauncherSession #389
Conversation
You should not take everything into one session. There are reruns which
have to be isolated trom the main run. And I am convinced that the reruns
also have to be isolated in each.
Dňa po 13. 9. 2021, 20:56 Emond Papegaaij ***@***.***>
napísal(a):
… A LauncherSession (JUnit Platform 1.8 feature) is started when the
Launcher is first used and closed when all tests have run. This allows
integrations to run pre and post fixtures.
------------------------------
You can view, comment on, or merge this pull request online at:
#389
Commit Summary
- [SUREFIRE-1935] Upgrade to JUnit Platform 1.8, start Launcher via
LauncherSession
File Changes
- *M*
surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProvider.java
<https://github.com/apache/maven-surefire/pull/389/files#diff-80115dd9c11ea216f73791da899b0ea3dc424f154dd7c8c65173de7071cc38ee>
(37)
- *M*
surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/LazyLauncher.java
<https://github.com/apache/maven-surefire/pull/389/files#diff-84b65bdf8ce1e6e82794216416cc3d8c7ea2f769e0a5e3e3f3425b68c685c617>
(24)
Patch Links:
- https://github.com/apache/maven-surefire/pull/389.patch
- https://github.com/apache/maven-surefire/pull/389.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#389>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAH7ER674FANSMJGXS43EPLUBZCPFANCNFSM5D6PDG2Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
I did think about this, but as the contract of LauncherSession is very unclear about this, I decided to put it all in one session. The documentation of LauncherSession states It will require some work to open a new session for each failure-iteration, but I can probably do that later this week. |
The PR is updated to start a new LauncherSession for every iteration during the failure reruns. |
please rebase with current code |
Done |
Any progress on this? |
@papegaaij |
We have been running a patched build for several months now with this change and it works very well. The downside to this solution in relation to the jira issue is that it only helps when the framework actually makes use of the launcher sessions. This is still very rare as it is a new feature. It is however the recommended way (by JUnit) of doing this and they seem reluctant to make other changes in this regard. |
I understand that you are aiming for loading heavy resources only once. |
The What a user does with a |
@papegaaij |
@Tibor17 I've rebased the PR and squashed the commits. |
} | ||
catch ( Exception e ) | ||
{ | ||
throw new SurefireReflectionException( e ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls use throw new SurefireReflectionException( e.grtLocalMessage(), e );
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SurefireReflectionException
only has one constructor, the one taking a Throwable cause
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@papegaaij
ok, no problem.
LGTM |
Thx for contributing! |
A LauncherSession (JUnit Platform 1.8 feature) is started when the Launcher is first used and closed when all tests have run. This allows integrations to run pre and post fixtures.