Skip to content

Try and give more helpful error message for bad surefire version #47492

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

Merged

Conversation

holly-cummins
Copy link
Contributor

@holly-cummins holly-cummins commented Apr 22, 2025

See discussion around #34681 (comment)

Detecting surefire is relatively easy, but I couldn't find a great way to detect the version. The best I could do was look at the name of the surefire booter. For Surefire 3.x it ends in _3, such as

surefire.real.class.path:/Users/holly/Code/quarkus/quarkus/integration-tests/gradle/target/surefire/surefirebooter-20250422184338999_3.jar

For Surefire 2 it's a random number, such as

surefire.real.class.path:/Users/holly/Downloads/code-with-quarkus/target/surefire/surefirebooter3233894128258247821.jar

I wouldn't want to do such fragile detection for something important, but since it's just enhancing an error message it should be ok.

Example (from a local test) output with new message:

java.lang.RuntimeException: The test class class org.acme.GreetingResourceTest should have been loaded with a QuarkusClassLoader, but instead it was loaded with jdk.internal.loader.ClassLoaders$AppClassLoader@2c854dc5. Is the version of the Surefire plugin at least 3.x?

Copy link

quarkus-bot bot commented Apr 22, 2025

Thanks for your pull request!

Your pull request does not follow our editorial rules. Could you have a look?

  • title should not end up with ellipsis (make sure the title is complete)

This message is automatically generated by a bot.

@holly-cummins holly-cummins changed the title Try and give more helpful error message if we can detect unsupported … Try and give more helpful error message for bad surefire version Apr 22, 2025
@holly-cummins holly-cummins requested a review from geoand April 22, 2025 18:57
Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link

quarkus-bot bot commented Apr 22, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit c3c0982.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@geoand geoand merged commit bf063ca into quarkusio:main Apr 23, 2025
57 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.23 - main milestone Apr 23, 2025
@gsmet gsmet modified the milestones: 3.23 - main, 3.22.1 Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants