jeudi 23 août 2018

VSTS - how to get Code Coverage results

I'm new to DevOps work and I've been tasked to setup a build for one of our .net Standard Library projects. I used the build template for this, which works great! But I want to add a code coverage into build output (there's a test project in the solution).

In the "VsTest - testAssemblies" task, I've checked the "Enable Code Coverage" option, as shown below:

enter image description here

I added a Publish code coverage task and it's asking for something called a "Summary File" - see below:

enter image description here

I'm not sure how to set this option? Has anyone done this?

I seem to get test results published in the build results without config, see below:

enter image description here

And I'd like the same for the Code Coverage tab in the build results, which is currently blank:

enter image description here

Also (may be a completely separate question), I was wondering - can I add a "Quality Gate" to say if Coverage is below 80% then fail the build?

Thanks for any advice in advance - it's a case of knowing what I want, but not sure how to achieve it!

Aucun commentaire:

Enregistrer un commentaire