FHIR Chat · Code Coverage and Unit Tests · committers

Stream: committers

Topic: Code Coverage and Unit Tests


view this post on Zulip Jason Walonoski (Oct 12 2018 at 14:25):

@Grahame Grieve has recently been adding unit tests. I think it would be useful to integrate a tool like https://codecov.io (or something similar) into the PR build process. This would allow the community to visually see which portions of the FHIR build are covered by unit tests and which portions are not. And it would help committers know where they could potentially add new unit tests. Thoughts?

view this post on Zulip Grahame Grieve (Oct 12 2018 at 18:58):

well, who cares how much to the build is covered by unit tests? OTOH, There's parts of the java code - the production relevant parts - where it would be nice indeed. Does anyone know anything about the performance hit?

view this post on Zulip Jason Walonoski (Oct 12 2018 at 20:36):

I don't really think there is a performance hit... I believe it works by analyzing the results of your JUnit test reports. The build pushes the results to the codecov servers after they are finished running, and it does the analysis out of band.

view this post on Zulip Chris Moesel (Oct 15 2018 at 12:15):

As I understand it, for Java projects, CodeCov requires JaCoCo. JaCoCo instruments the code in-memory while the unit tests are running -- so there's some impact there. I tried to find numbers -- but the best I could find was an old blog that said "less than 10%". As Jay said, however, the analysis and generation of the human-readable reports, however, would be farmed off to the CodeCov server. It's actually pretty easy to add the JaCoCo/CodeCov support, so it may be worth giving it a shot to see what the actual impact is. If it's too large an impact for day-to-day work, perhaps a special coverage build could be configured to run on master periodically.

view this post on Zulip Chris Moesel (Oct 15 2018 at 12:19):

BTW -- I think it's a great idea. If FHIR wants more community involvement in the building and maintaining of the infrastructure (including reference implementations) -- contributing unit tests is a great way for people to ease into it and learn the codebase at the same time.


Last updated: Apr 12 2022 at 19:14 UTC