You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Coverage not shown for subprojects in Explorer and Testing tab #1676
Coverage from jacoco for imported source is not being show in UI.
Only the project with unit tests is annotated with coverage percentage.
Dependency coverage is ignored in the UI.
Environment:
VS Code Version:1.87.0
Extension Version:v0.25.2023121402
JDK Type & Version:Eclipse Adoptium JDK 8.0.372
OS Type & Version: Windows
Step to Reproduce:
Set up an eclipse .project and .classpath with another project inside.
./proj/src (MainProject is here)
./proj/test/src (MyProject_Tests is here)
Inside (tests) project should contain .classpath with classpathentry src=/MainProject.
Run JUnit test coverage in a project MyProject_Tests which imports MainProject with:
Ctrl+Shift+P: Test: Run All Tests with Coverage
Expected Behavior:
Coverage generated for MyProject_Tests and MainProject too.
Actual Behavior:
Only MyProject_Tests coverage is shown in Explorer and Testing tab.
Note: jacoco.exec is generated with subproject class paths. However, VSCode shows coverage only for the _Tests project.
if (entry.getEntryKind() != ClasspathEntry.CPE_SOURCE ||
ProjectTestUtils.isTestEntry(entry)) {
continue;
For example, expand the classpath when it's a project/container, and persist all output -> source root relationships for those new discovered source kind entry.
When I run a full set of tests with coverage the Test Explorer blinks and refreshes constantly. It finally stops and it will have a subset of the full set of subprojects displayed in the Test Coverage area and will show all green checks for all the subprojects in the Test Explorer even though coverage is not shown for all subprojects. The number of tests run and shown in the Test Explorer area is also inconsistent as it will show 340+ tests and then when it is done execution it will show it complete with 184/184 or similar and the Test Coverage rarely shows all the subprojects and seemingly never has all of them showing the correct coverage numbers based on the aggragate JaCoCo report.
Activity
jdneo commentedon Mar 27, 2024
Seems like this part of the code should be improved:
vscode-java-test/java-extension/com.microsoft.java.test.plugin/src/main/java/com/microsoft/java/test/plugin/coverage/CoverageHandler.java
Lines 120 to 122 in 5751861
For example, expand the classpath when it's a project/container, and persist all output -> source root relationships for those new discovered source kind entry.
Fix #1676
jdneo commentedon Apr 1, 2024
Should be fixed by 99faaae
I'll schedule a pre-release sooner.
jdneo commentedon Apr 1, 2024
0.40.2024040105is released which fixes this issue.dishmaker commentedon Apr 5, 2024
Works fine. Thanks!
jlegue commentedon Sep 13, 2025
This issue has been closed however, it seems to still occur in my environment running the latest VS Code:
Version: 1.104.0 (system setup)
Commit: f220831ea2d946c0dcb0f3eaa480eb435a2c1260
Date: 2025-09-10T06:46:18.035Z
Electron: 37.3.1
ElectronBuildId: 12342881
Chromium: 138.0.7204.235
Node.js: 22.18.0
V8: 13.8.258.31-electron.0
OS: Windows_NT x64 10.0.26100
When I run a full set of tests with coverage the Test Explorer blinks and refreshes constantly. It finally stops and it will have a subset of the full set of subprojects displayed in the Test Coverage area and will show all green checks for all the subprojects in the Test Explorer even though coverage is not shown for all subprojects. The number of tests run and shown in the Test Explorer area is also inconsistent as it will show 340+ tests and then when it is done execution it will show it complete with 184/184 or similar and the Test Coverage rarely shows all the subprojects and seemingly never has all of them showing the correct coverage numbers based on the aggragate JaCoCo report.