tenninebt / vscode-koverage

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

Trouble finding coverage file names? #29

Closed zrolfs closed 1 year ago

zrolfs commented 1 year ago

Hello! I have a naive question. I'm a first-time user and just installed Koverage, but it doesn't look like it's able to find any of the files that I want to test coverage on. Am I missing something? I've included a screenshot below for context.

Thank you for your help! Zach

image

tenninebt commented 1 year ago

Hey Zach, sorry for the late reply (it has been crazy few months for me). The config does not look right. The coverageFileNames is a filter to define the actual coverage file (a .lcov file for example) while the coverageFilePaths specify where to locate the coverage file (Relative to your workspace root). We can arrange a call/chat to help you out (google meet or whatever suits you). Which timezone are you in?

zrolfs commented 1 year ago

The config might look weird because it's the user settings instead of the workspace settings. I think the issue here is I don't have a .lcov file; I had assumed this extension would generate one for me, but maybe not true?

zrolfs commented 1 year ago

I feel like I am close but tripping at the finish line. Anything obvious I'm missing? image

tenninebt commented 1 year ago

Hey, you are right, the extension is not meant to generate the coverage file (lcov, Jacoco...) it is only an easy way to visualize your workspace coverage. The generated coverage file should be somewhere near your sources, as inside it, the files' paths are probably relative (Can you send an extract of your coverage.xml? or the whole file?). Your paths look a bit "weird", in windows, I would expect them to use backslash C:\Users\UB03659\Downloads\jacoco-0.8.9\P1zGenerateCoverageReport (Might need to escape the path, so you might need to use C:\\Users\\UB03659\\Downloads\\jacoco-0.8.9\\P1zGenerateCoverageReport). (FYI, I use macOS)

zrolfs commented 1 year ago

The coverage file seems like it can be wherever I specify. I'm using VSCode as my IDE and this is done in the settings.json shown in the screenshot above.

The coverage.xml (excerpt below) does not look right, like jacoco encountered an error. My tests run fine, though...

ÀÀ EW7La5XFGFB3-9d7e1100 ‡Vý§u ‡Vþ.'Í${›ïË9t UVSignal ý ï½Ö UVPeakFinderzÿÿÿÿÿÿÿÿwüÿÿÿÿÿ&÷û3ŠüÑ; 1org/junit/runners/ParentRunner$ClassRuleCollectorÃ)p?³çôå3 Yorg/junit/internal/runners/rules/RuleMemberValidator$MemberMustBeNonStaticOrAlsoClassRule GÛÆuå©. (org/junit/internal/requests/ClassRequestö-Ö¶ø½ +org/junit/runner/notification/RunNotifier$5§ªcjú,9 2org/junit/internal/runners/statements/InvokeMethod•u/³Oñ/? (org/junit/runners/BlockJUnit4ClassRunnerzœûÿ÷x’}þüïvˆ¿yi#½)’õ. Iorg/junit/internal/runners/rules/RuleMemberValidator$FieldMustBeATestRule!ù>¬æ•ÝÓ *org/junit/runners/BlockJUnit4ClassRunner$2•µî hìhu 4org/junit/internal/runners/rules/RuleMemberValidatorÿ„xo}Û¿"?š org/junit/runner/Description=HF 3^é ùn¡ org/junit/runners/ParentRunner®à{ÿ¿ÿìîïýÇÿ  ˜w1%þƒy… 7org/eclipse/jdt/internal/junit/runner/DefaultClassifier  ¼¥¹¢ëš SavitzkyGolayFilter{ÿàðÿÿùÿÿ þX\­-2

You can use either / or \ in windows, but \ is a character key. I don't see a difference between the two paths you posted; can you elaborate?

tenninebt commented 1 year ago

I updated the paths (Github/markdown removed one of the ). And you are right, your coverage.xml looks wrong, that's not xml. I don't know how you generate it, but that does not look right. You need to follow a tutorial on how to generate coverage report using JUnit.

tenninebt commented 1 year ago

@zrolfs I haven't had answer since, I'll close the issue if no reply before this week-end. Thanks