Skip to content

Bug: Coverage not shown for subprojects in Explorer and Testing tab #1676

Description

@dishmaker

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions