tenninebt / vscode-koverage

VSCode code coverage extension
Apache License 2.0
26 stars 6 forks source link

Can't open coverage analysis for specific class. #27

Closed raffian closed 1 year ago

raffian commented 1 year ago

koverage: 0.0.13 vscode: 1.74.2 OS: Windows 10 / 21H2

We're using jacoco maven plugin to generate coverage files from maven as jacoco.xml, works perfectly as we can easily navigate all coverage files from browser. The problem we're having is with the koverage extension when clicking to open coverage data for a specific class, the editor displays error: "Could not be opened because the file was not found"

koverage config in settings.xml

   "koverage.coverageFilePaths": [
        "**"
    ],
    "koverage.lowCoverageThreshold": 80,
    "koverage.coverageFileNames": [

        "lcov.info",
        "cov.xml",
        "coverage.xml",
        "jacoco.xml"
    ],
Bojo38 commented 1 year ago

Hi, I have the same issue. I think this is a relative path issue.

tenninebt commented 1 year ago

Hi, sorry for the late reply.

Can you send a small repro project/example in a zip? Or at least a description of your project file tree and a coverage file?

Thanks

Bojo38 commented 1 year ago

To answer quickly (I will be able to complete tonight with screenshots): When I click on coverage, the plugin tries to open the file in root directory (for example: org/module1/file.java) but the real path is in src/main subdirectory (ie src/main/org/module1.file.java). This is typical of maven projects.

tenninebt commented 1 year ago

Any news? I can't investigate without a full use case (I need to be able to replicate the issue to debug). I think there might be a workaround, there is maybe a way to have the coverage file generated using the path relative to the workspace root.

raffian commented 1 year ago

No longer an issue for me. I had a misunderstanding of jacoco which contributed to believing I had a problem. My apologies,

tenninebt commented 1 year ago

Glad you managed to get it fixed. Are you still using the extension?

raffian commented 1 year ago

I switched to a different extension with inline coverage reporting in vscode editor which was more convenient for my needs.

tenninebt commented 1 year ago

Sure, wish I was of more help. The other extension is Coverage Gutters? (Just curious as I use them together, it is actually a good combo when together)

tenninebt commented 1 year ago

@Bojo38 do you have an easy repro package I can use to debug the issue? (Or @raffian even though I know you don't use it anymore) Thanks to both.

raffian commented 1 year ago

Yes, Coverage Gutters I'm using with Maven Jacoco plugin, perfect good combo for my needs.

m10653 commented 12 months ago

I am Running into the same issue. If you have your java source within a folder like ./src/java/com/example it appears to take only the package name and look for it in ./src/com/example. Is this a bug or is there a missing configuration to point to where the source dir should be.

tenninebt commented 12 months ago

@m10653 can you submit a new issue with a repro example? (A zip with the coverage and sources). Otherwise I can't really do anything about it.