我正在尝试创建一个MSBuild构建,以输出一个dotCover.html报告,以便上传到SonarQube。但是-即使所有的单元测试通过,dotCover也会出错。我不知道从这里往哪里走。
MsBuild文件
<ItemGroup>
<TestAssemblies Include="**\bin\Release\*.tests.dll" />
</ItemGroup>
<PropertyGroup>
<dlls>@(TestAssemblies, ' ')</dlls>
</PropertyGroup>
//Some other targets
<Target Name="DotCover">
<Exec Command='"%LOCALAPPDATA%\JetBrains\Installations\dotCover04\dotCover.exe" analyse /ReportType=HTML /Output="dotCover.html" /TargetWorkingDir=. /TargetExecutable:"packages\xunit.runner.console.2.1.0\tools\xunit.console.exe" /TargetArguments="$(dlls) -noshadow" /LogFile' />
</Target>dotCover LogFile中的错误
包含方法名的迭代器类IteratorsProcessor Xunit.Sdk.XunitTestAssemblyRunner+d__14的匹配方法: RunTestCollectionsAsync候选号:0父类型方法:.ctor;Dispose;GetTestFrameworkDisplayName;GetTestFrameworkEnvironment;SetupSyncContext;Initialize;AfterTestAssemblyStartingAsync;BeforeTestAssemblyFinishedAsync;RunTestCollectionsAsync;RunTestCollectionAsync;SetSynchronizationContext;<>n__0 15:17:29.703对提取的迭代器类IteratorsProcessor Xunit.Assert+d__56`1找不到匹配方法: ThrowsAsync候选号:0父类型方法:.ctor;Equals;ReferenceEquals;False;True;True;All;Collection;Contains;DoesNotContain;空;相等;相等;NotEmpty;NotEqual;NotEqual;单身;GetComparer;GetEqualityComparer;Equal;StrictEqual;NotEqual;NotStrictEqual;Throws;ThrowsAsync;ThrowsAny;ThrowsAnyAsync;Same;ThrowsAsync;ThrowsAny;ThrowsAny;ThrowsAsync;GuardArgumentNotNull;RecordException;RecordExceptionAsync;NotSame;en34;NotNull;Null;PropertyChanged;InRange;InRange;NotInRange;PropertyChanged;;#en34 20#;子集;包含;包含;匹配;匹配;相等;相等;#en33;;;IsNotType;IsType;IsType
任何帮助都将不胜感激。谢谢。
发布于 2016-01-25 14:21:19
如果没有可供使用的DotCover,则PDB无法针对程序集处理信息。可以通过将PDB添加到用于构建的配置下的<DebugType>pdbonly</DebugType>或将/debug:pdbonly开关添加到项目的编译器行中来设置要使用的/debug:pdbonly。您可以通过构建面板上的项目属性、高级选项部分或手工编辑csproj来设置这些属性。如果使用PDB不是最优的,那么您可以设置一个post条件,以便在dotcover之后运行以清除它们。
https://stackoverflow.com/questions/34981153
复制相似问题