Open DanielMSchmidt opened 7 years ago
Hi @DanielMSchmidt, I totally agree with you: generating a report in the lcov format would be great, e.g. we would be able to use services as codecov.io to make a pull request to fail when the flow coverage trend is going down (as we do with regular code coverage).
Generating such a report is technically possible, the main issues that have currently identified are:
translating the coverage data (eg. convert the coverage data collected from being "expressions based", that is how flow provides this data, to a "line based" lcov file, I started to look into this and it is pretty simple to convert the expression ranges into a line by line report)
as described in #20, it seems that a regular lcov report is also supposed to contain a line by line report of the covered lines (which, as an example, exclude the lines that are inline comments and shouldn't impact the line by line coverage), and flow doesn't currently output the "covered expressions ranges", a patch has been proposed by @clarkbw in facebook/flow#3231 (and apparently imported here https://phabricator.intern.facebook.com/D4861141, but I've not a facebook account and I'm not sure if it is publicly accessible with a regular facebook account)
we could probably workaround facebook/flow#3231 by processing the AST and build our own knowledge of the covered expression ranges, but it would much simpler (and definitely faster and safer) if flow can optionally provide this data given that it has already collected this knowledge internally.
The proposed patch from facebook/flow#3231is pretty small and some time ago I tried it and I've been able to easily build a custom flow binary from the patched sources, and so it is totally possible to use the patch to start to prototype the feature in more details in the meantime, and I would be definitely more than happy to help you on it!
Let me know if the above info are useful to you as a starting point.
Thanks a lot for your interest and help on this project! :heart:
This will be out in the latest version of flow (woo!)
Note: if it doesn't land on flow v0.71.0 it will land on v0.72.0. Sometimes cuts get backlogged a little; it is coming up though!
Appears to be available in flow v0.72.0
Not trying to be naggy, just honestly a bit lost in the above: where does that leave this? Can we get LCOV reports today? Or does this just mean it's possible to build now?
iirc means it's possible to build now
We are sending report to codecov.io now and it sort of works, but the local coverage and the coverage reported by codecov differ by a lot.
Hi there,
I would love to use this tool with codecov.io but I think I will need a lcov report, can you tell me what needs to be done than I will try to have a look into it 👍