ledatelescope / bifrost

A stream processing framework for high-throughput applications.
BSD 3-Clause "New" or "Revised" License
66 stars 29 forks source link

Coveralls coverage #97

Closed MilesCranmer closed 7 years ago

MilesCranmer commented 7 years ago

This is an announcement, not an issue.

Bifrost now has unit test coverage: Coverage Status

It's built into travis, so we won't be able to see test coverage for GPU-only modules.

On the coveralls page, there is a nice file-by-file listing of where greater test coverage is needed, and where we have hit 100% coverage.

MilesCranmer commented 7 years ago

It should also post coverage changes on each new pull request.

benbarsdell commented 7 years ago

This is great Miles!

Does it just include the Python files? 60% is actually higher than I expected given that it doesn't include GPU tests.

MilesCranmer commented 7 years ago

Yes, it's just the python files. Apparently there is a way to add it for C++ as well, but I assume that is for C++ tests, not something where they get linked with ctypes to C++ (I think we need some Google Tests). I could be wrong though. It would be great to see that coverage as well.

https://gronlier.fr/blog/2015/01/adding-code-coverage-to-your-c-project/

Also, I just realized there will also be a line-by-line highlighting of each file once I fix the paths (so they highlight where you aren't testing). More on this shortly.

MilesCranmer commented 7 years ago

Also, a lot of that coverage score could be coming from the old API: https://coveralls.io/builds/12262188/source?filename=%2Fusr%2Flocal%2Flib%2Fpython2.7%2Fdist-packages%2FBifrost-0.6.0-py2.7.egg%2Fbifrost%2Fblock.py

MilesCranmer commented 7 years ago
so they highlight where you aren't testing 

This sounds bad, sorry. I meant where the user isn't testing.

MilesCranmer commented 7 years ago

Okay, I have modified the relative paths on coveralls, and now each file shows line-by-line statistics on where the tests hit and where they don't.

MilesCranmer commented 7 years ago

Also, a lot of the test coverage points come from just hitting the function names without hitting their internals, see, e.g., 30% on this non-tested block: https://coveralls.io/builds/12262188/source?filename=%2Fusr%2Flocal%2Flib%2Fpython2.7%2Fdist-packages%2FBifrost-0.6.0-py2.7.egg%2Fbifrost%2Fblocks%2Fbinary_io.py

MilesCranmer commented 7 years ago

Coveralls apparently does not support multi-language reports: https://github.com/lemurheavy/coveralls-public/issues/544

However, codecov does: https://docs.codecov.io/v4.3.0/docs/merging-reports

MilesCranmer commented 7 years ago

So with Codecov, C++ coverage may be fairly simple: https://github.com/codecov/example-c

It shouldn't be difficult to switch to it, either.

MilesCranmer commented 7 years ago

Codecov working for python: https://codecov.io/gh/ledatelescope/bifrost