Windowscommunitytoolkit: Improve Code Coverage/Add to CI

Created on 14 Sep 2020  路  6Comments  路  Source: windows-toolkit/WindowsCommunityToolkit

thoughts on this PR? Should we investigate code coverage on the unit tests for these types of detailed scenarios to make sure we've got all cases exercised? I don't think we have a nice code-coverage thing setup as part of the Toolkit anywhere, eh?

@michael-hawker Regarding this, as a side note, I saw that ReSharper includes a Unit Test Coverage tool that's quite easy to use. It's not perfect (eg. it sometimes skips a line, and it doesn't seem to deal with compiler directives properly, but AFAIK code coverage tool are known not to be 100% accurate), but it should be nice to at least have a point of reference to check locally until we eventually setup some CI tool for this as well, as you mentioned. Here's what I'm getting right now on master:

image

I can definitely make a PR to improve the coverage even more 馃槉
As a path forward, I was thinking something like:

  • Use this Test Coverage tool individually on the new added features to ensure the new APIs being added are properly covered
  • Use this on master and make a separate PR to fill in the missing tests for the already existing APIs

How does this sound? Just not sure when to make the various PRs to minimize conflicts, assuming that's a concern.
As in, should we maybe merge at least #3351 before branching off from master again for this new PR? 馃

Let me know what you think!

_Originally posted by @Sergio0694 in https://github.com/windows-toolkit/WindowsCommunityToolkit/pull/3380#issuecomment-692143214_

build improvements maintenance

Most helpful comment

@michael-hawker Just as an FYI (not sure if it might be useful as a reference), ImageSharp is using the CodeCov bot for this.
For instance, here's a post that it generated in one of my PRs: https://github.com/SixLabors/ImageSharp/pull/1314#issuecomment-673563553

image

I mean that one might be a bit overkill, but I thought I'd mention it 馃槃

All 6 comments

Hello michael-hawker, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 馃檶

To clarify, I don't think the CI should be gated on this; however, a report should be generated so we can inspect it easily.

@michael-hawker Just as an FYI (not sure if it might be useful as a reference), ImageSharp is using the CodeCov bot for this.
For instance, here's a post that it generated in one of my PRs: https://github.com/SixLabors/ImageSharp/pull/1314#issuecomment-673563553

image

I mean that one might be a bit overkill, but I thought I'd mention it 馃槃

@Sergio0694 that's pretty cool, it's this one right? @azchohfi thoughts? Seems like an easy win?

@michael-hawker Yup, that's the one! 馃憤

This one is a github extension, not an azure devops, but it is possible to do the same in azure devops. As long as it exports a cobertura file (lets avoid JaCoCo), we can easily integrate it with ADO.

Was this page helpful?
0 / 5 - 0 ratings