aantron / bisect_ppx

Code coverage for OCaml and ReScript
http://aantron.github.io/bisect_ppx/demo/
MIT License
301 stars 60 forks source link

Fix collation of subdirectories in HTML report #401

Closed lukemaurer closed 1 year ago

lukemaurer commented 2 years ago

We have a project with top-level source files as well as subdirectories, and the listing was being cut off before the first subdirectory. This came down to the partition_files function, which did not correctly handle directories containing both files and subdirectories. (It also returned the directories in reverse order, which this patch also fixes.)

vch9 commented 1 year ago

Hi and thanks for the patch! We've been having the same issue for weeks/months and I tried to investigate a bit. After producing a few debugging traces I tried your patch and it fixed the problem on our side (the cause is the same as yours)

I believe this closes https://github.com/aantron/bisect_ppx/issues/409?

What do you think @aantron?

vch9 commented 1 year ago

Also note that this impacts the coverage %:

Without this patch on master

$ dune exec vendors/bisect_ppx/src/report/main.exe --  summary --coverage-path .                    
Coverage: 60470/285629 (21.17%)

$ dune exec vendors/bisect_ppx/src/report/main.exe --  html --ignore-missing-files --coverage-path .
> 19.10% (taken from the index)

With the patch:

$ dune exec vendors/bisect_ppx/src/report/main.exe --  summary --coverage-path .                    
Coverage: 60470/285629 (21.17%)

$ dune exec vendors/bisect_ppx/src/report/main.exe --  html --ignore-missing-files --coverage-path .
> 21.17% (taken from the index)
aantron commented 1 year ago

Thanks @lukemaurer and @vch9! I am currently finishing up bugfixes in another project and will review this shortly!

aantron commented 1 year ago

Thank you!