vscode-java-test icon indicating copy to clipboard operation
vscode-java-test copied to clipboard

Quarkus junit tests don't work

Open l0co opened this issue 2 months ago • 6 comments

One cannot run unit/integration tests with Quarkus > 3.22. Please compare with:

  1. https://github.com/quarkusio/quarkus/issues/48014#issuecomment-2948700542
  2. https://github.com/quarkusio/quarkus/issues/47656
  3. https://quarkus.io/blog/test-classloading-rewrite/

It looks like, the fix has been applied in eclipse runner, but has not been applied for the VSCode extenstion, which is still from Apr 03 2025. I think you have to upgrade dependency org.eclipse.jdt.junit5.runtime_1.1.300.v20231214-1952.jar which seems to very old (2023?) to org.eclipse.jdt.junit5.runtime-1.1.400.jar, plus all related dependencies.

l0co avatar Oct 15 '25 12:10 l0co

Hi @l0co, I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.

Workaround

  • Manually upgrade the JDT JUnit5 runtime shipped with the VS Code Java Test extension:
    1. Download org.eclipse.jdt.junit5.runtime-1.1.400.jar from https://download.eclipse.org/jdt/junit/updates/download/release/1.1.400/
    2. Locate your extension folder (e.g. ~/.vscode/extensions/vscjava.vscode-java-test-<version>/server/) and replace org.eclipse.jdt.junit5.runtime_1.1.300.v20231214-1952.jar.
    3. Reload VS Code.

Track upstream fix: once the extension updates its org.eclipse.jdt.junit5.runtime dependency, you can revert to the official release.

Relevant references

  • quarkusio/quarkus#48014: fix applied in Eclipse runner → https://github.com/quarkusio/quarkus/issues/48014#issuecomment-2948700542
  • quarkusio/quarkus#47656: classloading issues after test rewrite → https://github.com/quarkusio/quarkus/issues/47656
  • Quarkus blog “Test classloading rewrite” → https://quarkus.io/blog/test-classloading-rewrite/

The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!

github-actions[bot] avatar Oct 15 '25 12:10 github-actions[bot]

As @l0co says, the fix for this is https://github.com/eclipse-jdt/eclipse.jdt.ui/pull/2258. It doesn't seem to have made it into the runner extension yet, which isn't surprising, since the last update of the runner extension was seven months ago.

I've tried the suggested workaround. I had to pull the jdt jar from a complete installation, because the url was a 404. Even with that adjustment, I get "no tests found" after patching. Adjusting the jar reference the package.json in the extension doesn't help. However, others report it does work: https://github.com/quarkusio/quarkus/issues/48014#issuecomment-3466977677

holly-cummins avatar Oct 30 '25 09:10 holly-cummins

Hello, this fix would be awesome. Thanks!

mdima avatar Nov 05 '25 10:11 mdima

@fbricon or @rgrunber can you help here? this is quite annoying that the vscode-test is using older eclipse which then breaks proper tests :/

maxandersen avatar Nov 20 '25 14:11 maxandersen

JUnit runtimes need to be updated in this extension, notably for JUnit 6 support, so it should be addressed soon(TM), either by @wenytang-ms @chagong or @snjeza

fbricon avatar Nov 20 '25 14:11 fbricon

This is an upstream jdt.ui issue. I have created https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/2654

snjeza avatar Nov 20 '25 23:11 snjeza