Collect and visualize code coverage
Opened this issue · 3 comments
The project has now quiet some test implemented but we don't know what exactly is covered.
I've also started looking around for tools providing this but could only find some 3rd-party stuff.
Questions:
- How and where to present the data? Will it be like a script you run locally? Or will it run in CI and output coverage to CI console?
Some ideas: - For every app build (locally and CI) the coverage will be created (normally as HTML file).
-- In the local case, it should be written to some file at a specific location, maybe somehow tagged with branch name and commit hash, if possible.
-- For CI, the created HTML should be saved as an artifact and linked in the CI console output, if this is possible.
I guess, in the first instance it would be also fine to simply have a CI console output like: Test coverage: Functional coverage: x%, branch coverage: y%
and adding the detailed coverage report later.
It seems, there are two main tools for Kotlin code coverage collection:
- JaCoCo - Java Code Coverage Library, which exists quiet a while.
- kotlinx-cover - Kotlin specific code coverage tool, developed by the Kotlin guys itself. Relative young project.
There is an external free service called codecov for visualization, which used by many open source projects. Both tools produce an output which can be uploaded to this service via CI. Also both tools can create a local coverage report as HTML.
I've removed the milestone. There is no special need for it to be part of any specific version.