binhonglee / coco

Code coverage for Nim lang (CLI + library)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`Clean up past reports` buggy; ignores report_path ; coverage shouldn't be checked in?

timotheecour opened this issue · comments

running ./coco shouldn't affect git status ;

git clone https://github.com/samuelroy/coco
cd coco
nimble build
./coco --report_path=/tmp/d19
git status
        deleted:    coverage/amber.png
        deleted:    coverage/emerald.png
        deleted:    coverage/gcov.css
        deleted:    coverage/glass.png
        deleted:    coverage/index-sort-f.html
        deleted:    coverage/index-sort-l.html
        deleted:    coverage/index.html
        deleted:    coverage/nim-coverage/coco.nim.func-sort-c.html
        deleted:    coverage/nim-coverage/coco.nim.func.html
        deleted:    coverage/nim-coverage/coco.nim.gcov.html
        deleted:    coverage/nim-coverage/index-sort-f.html
        deleted:    coverage/nim-coverage/index-sort-l.html
        deleted:    coverage/nim-coverage/index.html
        deleted:    coverage/ruby.png
        deleted:    coverage/snow.png
        deleted:    coverage/updown.png
        modified:   lcov.info

        tests/compilation
        tests/foo
        tests/report/cleanup_past_report
        tests/report/generate_coverage
  • coverage is removed even though I specified ./coco --report_path=/tmp/d19 so I'd assume it'd instead remove /tmp/d19

  • I'm actually confused about coverage ; was this intended to be checked in this repo or was it an artifact of running ./coco and checking in automatically generated files in the repo? if the latter, these should be deleted from this repo
    even after removing coverage, ./coco still works which makes me think snow.png (etc) are generated by something else (maybe lcov?)

  • I really like when git status stays clean after running commands (or at least everything generated goes under 1 directory); maybe 1 option is to generate:

./coco
lcov.info
coverage (default value for report_path)
nimcache

under a build/ dir that's gitignored?

commented

@timotheecour coverage/ in this repo is only used as an example of the report generated by Coco.

About --report_path it does the job correctly, cleanup then creating the report at that path. When you ran the command ./coco, it ran my tests and one was removing coverage/. Totally unnecessary and confusing. It's fixed now.

Agree about git status. It should stay clean as much as possible. Now, by default, you should only get 1 directory with the HTML report (I should add an option to disable the generation) and your LCOV file. This one is really useful in your project as it's read by Coverage Gutters in VSCode.