codecov-ruby icon indicating copy to clipboard operation
codecov-ruby copied to clipboard

Enable branch coverage

Open klyonrad opened this issue 5 years ago • 7 comments

The simplecov gem added support for displaying branch coverage for a while now. It would be nice if codecov would do that too.

klyonrad avatar Jul 14 '20 11:07 klyonrad

Thanks here @klyonrad, we are looking to support Simplecov 0.18+ and will add its branch coverage to the product map.

thomasrockhu avatar Aug 28 '20 03:08 thomasrockhu

@klyonrad, do you have a build with branch coverage? Now that 0.18+ is supported, we'd love to move forward here.

thomasrockhu avatar Nov 05 '20 16:11 thomasrockhu

Sorry, @thomasrockhu I don't quite understand the question or what you require. I used branch coverage a couple of times in my projects and it worked. Enabling it should require minimal configuration

klyonrad avatar Nov 05 '20 16:11 klyonrad

@klyonrad, sorry for not explaining myself more. Do you have a public repository that is currently collecting branch coverage?

thomasrockhu avatar Nov 06 '20 05:11 thomasrockhu

@thomasrockhu Here would be an exmaple: https://github.com/klyonrad/lazybar/blob/master/spec/spec_helper.rb#L5

klyonrad avatar Dec 09 '20 22:12 klyonrad

👋 @thomasrockhu, our team was also trying to report branch coverage results and noticed that they don't get picked up by the codecov gem. We submit our results by configuring the SimpleCov::Formatter::Codecov: https://github.com/DataDog/dd-trace-rb/blob/7e6fdb0a8c948a9e36f6f618350566e74c2d92b1/Rakefile#L958-L967

Like @thomasrockhu said, adding SimpleCov.enable_coverage :branch to any project that is currently exporting to Codecov will allow you to see that "branches": [...] data is present in the .resultset.json SimpleCov result, but not present in the payload sent by codecov.

marcotc avatar Feb 02 '21 22:02 marcotc

Hi @marcotc! We are working on parsing the branch coverage information this month. After that's in place, I'll be making the change to the uploader to send that information to Codecov using this gem. I'll ping back here with updates, but we are really looking forward to getting this feature rolled out.

thomasrockhu avatar Feb 05 '21 03:02 thomasrockhu