microsoft / vscode-java-test

Run and debug Java test cases in Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-test
Other
297 stars 132 forks source link

Coverage is not displayed for tests with @QuarkusTest #1719

Closed mhagnumdw closed 3 months ago

mhagnumdw commented 4 months ago

Hi!

Simple project to demonstrate that the coverage of tests annotated with @QuarkusTest (GreetingResourceTest.java) is not displayed in vscode, but the coverage of the other tests (CollectionUtilsTest.java) is displayed: https://github.com/mhagnumdw/quarkus-vscode-java-test

image

edit: On the maven command line the coverage is ok.

jacksoncastro commented 4 months ago

I have the same problem here. Can anyone help?

jdneo commented 4 months ago

Looks like it's due to the jacoco version unalignment. The project's dependency contains jacoco 0.8.12. While the jacoco embedded in java test runner extension is 0.8.11. I tested locally to upgrade the jacoco version to 0.8.12 and it works.

So I need to update the jacoco version and make a pre-release to unblock you.

Another thing that can be considered is to read the existing exec file which is configured by user. Since I noticed that the QuarkusTest will always generate jacoco data file under target folder.

jdneo commented 4 months ago

Hi

Please try the pre-release 0.42.2024080106

mhagnumdw commented 4 months ago

Please try the pre-release 0.42.2024080106

@jdneo, this version worked as expected. Thanks!