在构建过程中运行nunit测试之后。我想看看那个版本的结果。如果我想点击在VS2010中打开的日志文件中显示的查看测试结果链接。然后它首先抛出错误,说无法连接到服务器,再次点击将显示VS2010的测试结果窗口中的结果。但它也没有在TFS网页中显示任何视图测试结果链接,任何人都可以看到结果。不知道遗失了什么。
4 projects/solutions compiled
1 test run(s) completed - 0% average pass rate (0% total pass rate)
0/1 test(s) passed, 1 failed, 0 inconclusive, View Test Results
No Code Coverage Results
Nunit的My Changed构建配置文件:
<If Condition="[Not DisableTests]" DisplayName="If Not DisableTests" sap:VirtualizedContainerService.HintSize="1200,1867" mtbwt:BuildTrackingParticipant.Importance="Low">
<If.Then>
<Sequence DisplayName="Run Tests" sap:VirtualizedContainerService.HintSize="1075,1761" mtbwt:BuildTrackingParticipant.Importance="Low">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<If Condition="[Not TestSpecs Is Nothing]" DisplayName="If Not TestSpecs Is Nothing" sap:VirtualizedContainerService.HintSize="1053,1637" mtbwt:BuildTrackingParticipant.Importance="Low">
<If.Then>
<ForEach x:TypeArguments="mtbwa:TestSpec" DisplayName="For Each TestSpec in TestSpecs" sap:VirtualizedContainerService.HintSize="928,1531" mtbwt:BuildTrackingParticipant.Importance="Low" Values="[TestSpecs]">
<ActivityAction x:TypeArguments="mtbwa:TestSpec">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="mtbwa:TestSpec" Name="spec" />
</ActivityAction.Argument>
<TryCatch DisplayName="Try Run Tests" sap:VirtualizedContainerService.HintSize="898,1425" mtbwt:BuildTrackingParticipant.Importance="Low">
<TryCatch.Try>
<If Condition="[TypeOf spec Is Microsoft.TeamFoundation.Build.Workflow.Activities.TestMetadataFileSpec]" DisplayName="If spec Is TestMetadataFileSpec" sap:VirtualizedContainerService.HintSize="880,1238" mtbwt:BuildTrackingParticipant.Importance="None">
<If.Then>
<Sequence DisplayName="Run MSTest for Metadata File" sap:VirtualizedContainerService.HintSize="222,1132">
<Sequence.Variables>
<Variable x:TypeArguments="mtbwa:TestMetadataFileSpec" Name="testMetadataFile" />
<Variable x:TypeArguments="x:String" Name="localTestMetadata" />
</Sequence.Variables>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<Assign x:TypeArguments="mtbwa:TestMetadataFileSpec" DisplayName="Assign spec to testMetadataFile" sap:VirtualizedContainerService.HintSize="200,22" mtbwt:BuildTrackingParticipant.Importance="Low" To="[testMetadataFile]" Value="[DirectCast(spec, Microsoft.TeamFoundation.Build.Workflow.Activities.TestMetadataFileSpec)]" />
<mtbwa:ConvertWorkspaceItem DisplayName="Convert Server Path to Local Path" sap:VirtualizedContainerService.HintSize="200,22" mtbwt:BuildTrackingParticipant.Importance="Low" Input="[testMetadataFile.MetadataFileName]" Result="[localTestMetadata]" Workspace="[Workspace]" />
<mtbwa:MSTest Category="[testMetadataFile.CategoryFilter]" CommandLineArguments="[testMetadataFile.MSTestCommandLineArgs]" DisplayName="Run MSTest for Metadata File" Flavor="[platformConfiguration.Configuration]" sap:VirtualizedContainerService.HintSize="200,22" MaxPriority="[testMetadataFile.MaximumPriority]" MinPriority="[testMetadataFile.MinimumPriority]" PathToResultsFilesRoot="[TestResultsDirectory]" Platform="[platformConfiguration.Platform]" SearchPathRoot="[outputDirectory]" TestLists="[testMetadataFile.TestLists]" TestMetadata="[localTestMetadata]" TestSettings="[String.Empty]" />
</Sequence>
</If.Then>
<If.Else>
<Sequence DisplayName="Run NUnit for Test Assemblies" sap:VirtualizedContainerService.HintSize="633,1132" mtbwt:BuildTrackingParticipant.Importance="Low">
<Sequence.Variables>
<Variable x:TypeArguments="mtbwa:TestAssemblySpec" Name="testAssembly" />
<Variable x:TypeArguments="scg:IEnumerable(x:String)" Name="testAssemblies" />
<Variable x:TypeArguments="x:String" Default="[String.Empty]" Name="testFlavor" />
<Variable x:TypeArguments="x:String" Default="[String.Empty]" Name="testPlatform" />
<Variable x:TypeArguments="x:Int32" Name="NUnitResult" />
<Variable x:TypeArguments="x:String" Name="variable1" />
</Sequence.Variables>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<Assign x:TypeArguments="mtbwa:TestAssemblySpec" DisplayName="Assign spec to testAssembly" sap:VirtualizedContainerService.HintSize="611,22" mtbwt:BuildTrackingParticipant.Importance="Low" To="[testAssembly]" Value="[DirectCast(spec, Microsoft.TeamFoundation.Build.Workflow.Activities.TestAssemblySpec)]" />
<mtbwa:FindMatchingFiles DisplayName="Find Test Assemblies" sap:VirtualizedContainerService.HintSize="611,22" mtbwt:BuildTrackingParticipant.Importance="Low" MatchPattern="[String.Format("{0}\{1}", outputDirectory, testAssembly.AssemblyFileSpec)]" Result="[testAssemblies]" />
<If Condition="[testAssemblies.Count() > 0]" DisplayName="If Test Assemblies Found" sap:VirtualizedContainerService.HintSize="611,884" mtbwt:BuildTrackingParticipant.Importance="Low">
<If.Then>
<Sequence DisplayName="Run Tests and Publish Results" sap:VirtualizedContainerService.HintSize="486,778">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<mtbwa:InvokeProcess Arguments="[String.Format("/xml:nunit-tests.xml /framework:net-4.0 {0}", String.Join(" ",
testAssemblies))]" DisplayName="Invoke NUnit" FileName="[System.IO.Path.Combine(NUnitBinaryDirectory, "nunit-console.exe")]" sap:VirtualizedContainerService.HintSize="464,184" Result="[[NUnitResult]]" WorkingDirectory="[outputDirectory]">
<mtbwa:InvokeProcess.ErrorDataReceived>
<ActivityAction x:TypeArguments="x:String">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:String" Name="errOutput" />
</ActivityAction.Argument>
</ActivityAction>
</mtbwa:InvokeProcess.ErrorDataReceived>
<mtbwa:InvokeProcess.OutputDataReceived>
<ActivityAction x:TypeArguments="x:String">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:String" Name="stdOutput" />
</ActivityAction.Argument>
</ActivityAction>
</mtbwa:InvokeProcess.OutputDataReceived>
</mtbwa:InvokeProcess>
<mtbwa:InvokeProcess Arguments="[String.Format("-n {0} -t {1} -p ""{2}"" -f {3} -b ""{4}"" -v 2010",
 "nunit-tests.xml",
 BuildDetail.TeamProject,
 BuildSettings.PlatformConfigurations(0).Platform,
 BuildSettings.PlatformConfigurations(0).Configuration,
 BuildDetail.BuildNumber)]" DisplayName=" Publish NUnit Results" FileName="[Path.Combine(NUnitTfsPublisherDirectory, "NUnitTfs.exe")]" sap:VirtualizedContainerService.HintSize="464,184" WorkingDirectory="[outputDirectory]">
<mtbwa:InvokeProcess.ErrorDataReceived>
<ActivityAction x:TypeArguments="x:String">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:String" Name="errOutput" />
</ActivityAction.Argument>
</ActivityAction>
</mtbwa:InvokeProcess.ErrorDataReceived>
<mtbwa:InvokeProcess.OutputDataReceived>
<ActivityAction x:TypeArguments="x:String">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:String" Name="stdOutput" />
</ActivityAction.Argument>
</ActivityAction>
</mtbwa:InvokeProcess.OutputDataReceived>
</mtbwa:InvokeProcess>
<If Condition="[NUnitResult <> 0]" DisplayName="If NUnit Tests Failed" sap:VirtualizedContainerService.HintSize="464,206">
<If.Then>
<Assign DisplayName="Set Test Status To Failed" sap:VirtualizedContainerService.HintSize="291,100">
<Assign.To>
<OutArgument x:TypeArguments="mtbc:BuildPhaseStatus">[BuildDetail.TestStatus]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="mtbc:BuildPhaseStatus">[Microsoft.TeamFoundation.Build.Client.BuildPhaseStatus.Failed]</InArgument>
</Assign.Value>
</Assign>
</If.Then>
</If>
</Sequence>
</If.Then>
</If>
</Sequence>
</If.Else>
</If>
答案 0 :(得分:0)
在Dev10中没有实现在Web Access中查看测试结果,也没有在Visual Studio中打开测试结果文件(trx)的协议处理程序。这就解释了为什么构建摘要不显示TFS网页上的“查看测试结果”链接。
根据Visual Studio问题,第一次单击VS中的“查看测试结果”时,它是否总是抛出“无法连接到服务器”错误?当你说“再次点击”时,你的意思是再次点击“查看测试结果”?您是否可以检查事件日志以查看是否存在任何相关错误以及更多信息。