dotcover

How can I fail a TeamCity build if dotCover doesn't report a high enough result?

微笑、不失礼 提交于 2019-12-07 02:50:41
问题 I would like TeamCity to run my mSpec tests and report on the code covered by the tests. I would also like TeamCity to report that a build has failed if code coverage in certain namespaces doesn't meet a threshold (e.g. MyProduct.ImportantStuff must be 100% , but MyProduct.LegacyStuff must be [ 23% or whatever it currently is to ensure we don't add new stuff without covering tests ]. I initially looked at dotCover as it's integrated into TeamCity. I have since been looking at OpenCover as I

TeamCity with dotCover does not include all my assemblies in coverage report

只谈情不闲聊 提交于 2019-12-07 02:32:07
问题 I want to run NUnit on TeamCity and generate report with dotCover. But for some reasons I cannot get the coverage report for all my project assemblies. TeamCity config as below Teamcity: 6.5.3 NUnit: 2.5.10 .NET Runtime: Platform: x86 .NET Runtime: Version: v4.0 dotCover: bundled with TC not customized I have checked that all *.dll *.xml *.pdb files are there in the directory as expected as below (reference DLLs are not listed) MY.PROJECT.A.dll MY.PROJECT.A.pdb MY.PROJECT.A.xml MY.PROJECT.B

Code Coverage in .Net Core 2.0

做~自己de王妃 提交于 2019-12-05 18:55:19
问题 How can I generate code coverage in .Net Core 2.0? I tried the following: "TestPlatform\vstest.console.exe" --collect:"Code Coverage" But I got this error message: Data collector 'Code Coverage' message: Cannot find CodeCoverage.exe. I tried dotCover latest version 2017.2 which I am able to get the coverage on the local machine, but when the same is run in the TFS Build no coverage information is generated. I am not sure when NetCore Test task in TFS will get support for code coverage. How

How can I fail a TeamCity build if dotCover doesn't report a high enough result?

柔情痞子 提交于 2019-12-05 08:18:48
I would like TeamCity to run my mSpec tests and report on the code covered by the tests. I would also like TeamCity to report that a build has failed if code coverage in certain namespaces doesn't meet a threshold (e.g. MyProduct.ImportantStuff must be 100% , but MyProduct.LegacyStuff must be [ 23% or whatever it currently is to ensure we don't add new stuff without covering tests ]. I initially looked at dotCover as it's integrated into TeamCity. I have since been looking at OpenCover as I couldn't get TC to fail the build on low coverage. I got OpenCover working but I would still like to

Attribute filter syntax for code coverage in TeamCity

送分小仙女□ 提交于 2019-12-05 02:46:59
Anyone knows the syntax for excluding code from coverage in Teamcity? I am using the ExcludeFromCodeCoverageAttribute on certain methods and want those excluded. It works well in Visual Studio but I don't understand how to get the same behavior in TeamCity. The Field I am trying to configure is located in MsTest -> .Net Coverage -> Attribute Filters: I have tried this: -:ExcludeFromCodeCoverageAttribute and this -:ExcludeFromCodeCoverage After trying out a few variations this worked: -:System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute Make sure you add this filter inside

dotCover and xUnit not gathering coverage statistics in some environments

扶醉桌前 提交于 2019-12-04 16:43:45
We're using dotCover 2.7 and xUnit.net 1.9.2. On my machine (Windows 7) and a co-worker's machine (Windows 8) we can run dotCover from the command line against one of our unit test assemblies that uses xUnit.net and get correct coverage reporting. On our build machine (Windows Server 2008 R2 Standard) when we run the same thing the only code coverage that dotCover reports is the unit test assembly itself. We're running xUnit.net using the MSBuild task. Here's the relevant pieces from the .msbuild file. <UsingTask TaskName="Xunit.Runner.MSBuild.xunit" AssemblyFile="$(PackagesDir)xunit.$

Code Coverage in .Net Core 2.0

孤街浪徒 提交于 2019-12-04 02:37:22
How can I generate code coverage in .Net Core 2.0? I tried the following: "TestPlatform\vstest.console.exe" --collect:"Code Coverage" But I got this error message: Data collector 'Code Coverage' message: Cannot find CodeCoverage.exe. I tried dotCover latest version 2017.2 which I am able to get the coverage on the local machine, but when the same is run in the TFS Build no coverage information is generated. I am not sure when NetCore Test task in TFS will get support for code coverage. How can I publish the results from DotCover in TFS also, to use DotCover Commandline to generate the Coverage

Weird test coverage results for iterator block, why are these statements not executed?

你说的曾经没有我的故事 提交于 2019-12-03 17:22:41
问题 I'm using dotCover to analyze code coverage of my unit tests, and I'm getting some strange results... I have an iterator method for which the coverage is not complete, but the statements that are not covered are just the closing braces at the end of the method. Here's the method I'm testing: public static IEnumerable<T> CommonPrefix<T>( this IEnumerable<T> source, IEnumerable<T> other, IEqualityComparer<T> comparer) { source.CheckArgumentNull("source"); other.CheckArgumentNull("other");

TeamCity dotCover report path for Sonar

流过昼夜 提交于 2019-12-03 07:30:22
问题 I'm trying to integrate the sonar analysis into by TeamCity build process. I have a NUnit build step which runs my unit tests and then runs dotCover for the coverage. My next step is the sonar-runner. The configuration that currently exists is; gallio.mode=dotCover, sonar.gallio.mode=reuseReport but I also need sonar.gallio.reports.path. Does anybody know the path to the dotCover report generated in the the previous step? 回答1: I couldn't find a way to do this using the built in NUnit runner.

Weird test coverage results for iterator block, why are these statements not executed?

戏子无情 提交于 2019-12-03 05:35:25
I'm using dotCover to analyze code coverage of my unit tests, and I'm getting some strange results... I have an iterator method for which the coverage is not complete, but the statements that are not covered are just the closing braces at the end of the method. Here's the method I'm testing: public static IEnumerable<T> CommonPrefix<T>( this IEnumerable<T> source, IEnumerable<T> other, IEqualityComparer<T> comparer) { source.CheckArgumentNull("source"); other.CheckArgumentNull("other"); return source.CommonPrefixImpl(other, comparer); } private static IEnumerable<T> CommonPrefixImpl<T>( this