Closed chezihp closed 1 year ago
Thanks for your report @chezihp, and nice find! Do you get a traceback, on just incorrect output from pycobertura?
Is there any chance for you to put a PR together with a test that displays the failure?
Hey. Just incorrect output. I'll put a PR as soon I'll find the time to do it.
Can you provide a reproducible test case?
➜ pycobertura pycobertura diff --source1 src.zip --source2 . cobertura1.xml cobertura2.xml
Filename Stmts Miss Cover Missing
---------- ------- ------ -------- ---------
TOTAL 0 0 +100.00%
➜ pycobertura echo $?
3
➜ pycobertura pycobertura diff --source1 . --source2 . cobertura1.xml cobertura2.xml
Filename Stmts Miss Cover Missing
---------- ------- ------ -------- ---------
TOTAL 0 0 +100.00%
➜ pycobertura echo $?
0
Hey, Thanks for this project. Really helpful! Im using both ZipFileSystem and DirectoryFileSystem together (one for Cobertura1 and the other for Cobertura2). Found out that the line mapping between the two FileSystems is not working properly because ZipFileSystem adds 'b' prefix to each source line (this is expected) while DirectoryFileSystem doesn't. This effects cases for example when the same source line is missed in both coverage.xml files but the line still marked as status=False and reason="line-edit". The workaround Im currently using is to override the ZipFileSystem.open method and wrapping the opened file with TextIOWrapper.