2016-10-17 28 views
0

我有一个TFS构建Vnext与2测试步骤(也,解决方案构建,...但这不是问题)的过程 一个测试步骤是为单元测试和另一个集成测试。TFS构建vnext无法发布测试结果

集成测试的步骤很好,在步骤结束时在TFS中发布测试没有问题,我在构建摘要中有图表。

然而,对于具有单元测试的步骤,TFS不能发布的结果,我有在生成输出这样的警告:

无法发布测试结果:的startDate的值不是 部分允许的值。

我不明白为什么我有这个输出,直到我打开测试结果文件trx。

file.trx:

<Times creation="2016-10-17T12:08:09.1454974+02:00" queuing="2016-10-17T12:08:09.1454974+02:00" start="0001-01-01 00:00:00Z" finish="2016-10-17T12:09:26.9725722+02:00" /> 

TFS不会影响该属性的正确值开始在节点时代。 为什么?
我有〜80个集成测试和〜1400个单元测试,它是单元测试的数量吗?或者是其他东西 ?

我试着删除单元测试步骤并重新创建它。

技术信息: 测试框架:

  • NUnit的3.5.0与NUnit的VS测试适配器3.4.1
  • TFS 2015年所有要求满足
  • 任务使用:Visual Studio的测试

例如,我试图将Nunit降级到3.4.1以适应适配器的版本,但它没有改变任何东西。

测试任务配置(用于测试任务相同的配置):

  • 执行选项:
    • 测试组件:一个组件
    • 运行设置文件:请参见下面
    • 代码覆盖率已启用:true
    • 平行运行:真
  • 高级执行选项:
    • VSTest版本:VS 2015年
  • 报告选项:
    • 平台:任何CPU
    • 配置:释放
    • 载测试附件:真

RunSettings文件:

<?xml version="1.0" encoding="utf-8"?> 
<!-- File name extension must be .runsettings --> 
<RunSettings> 
    <RunConfiguration> 
    <TreatTestAdapterErrorsAsWarnings>true</TreatTestAdapterErrorsAsWarnings> 
    <ResultsDirectory>.\TestResults</ResultsDirectory> 
    </RunConfiguration> 
    <DataCollectionRunSettings> 
    <DataCollectors> 
     <DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 
     <Configuration> 
      <CodeCoverage> 
      <!-- 
      About include/exclude lists: 
      Empty "Include" clauses imply all; empty "Exclude" clauses imply none. 
      Each element in the list is a regular expression (ECMAScript syntax). See http://msdn.microsoft.com/library/2k3te2cs.aspx. 
      An item must first match at least one entry in the include list to be included. 
      Included items must then not match any entries in the exclude list to remain included. 
      --> 

      <!-- Match assembly file paths: --> 
      <ModulePaths> 
       <Include> 
       <ModulePath>.*\.dll$</ModulePath> 
       <ModulePath>.*\.exe$</ModulePath> 
       </Include> 
       <Exclude> 
       <ModulePath>.*tests.*.dll</ModulePath> 
       </Exclude> 
      </ModulePaths> 

      <!-- Match fully qualified names of functions: --> 
      <!-- (Use "\." to delimit namespaces in C# or Visual Basic, "::" in C++.) --> 
      <Functions> 
       <Exclude>      
       </Exclude> 
      </Functions> 

      <!-- Match attributes on any code element: --> 
      <Attributes> 
       <Exclude> 
       <!-- Don't forget "Attribute" at the end of the name --> 

       <Attribute>^System\.Diagnostics\.DebuggerHiddenAttribute$</Attribute> 
       <Attribute>^System\.Diagnostics\.DebuggerNonUserCodeAttribute$</Attribute> 
       <Attribute>^System\.Runtime\.CompilerServices.CompilerGeneratedAttribute$</Attribute> 
       <Attribute>^System\.CodeDom\.Compiler.GeneratedCodeAttribute$</Attribute> 
       <Attribute>^System\.Diagnostics\.CodeAnalysis.ExcludeFromCodeCoverageAttribute$</Attribute> 
       </Exclude> 
      </Attributes> 

      <!-- Match the path of the source files in which each method is defined: --> 
      <Sources> 
       <Exclude> 
       <Source>.*\\atlmfc\\.*</Source> 
       <Source>.*\\vctools\\.*</Source> 
       <Source>.*\\public\\sdk\\.*</Source> 
       <Source>.*\\microsoft sdks\\.*</Source> 
       <Source>.*\\vc\\include\\.*</Source> 
       </Exclude> 
      </Sources> 

      <!-- Match the company name property in the assembly: --> 
      <CompanyNames> 
       <Exclude> 
       <CompanyName>.*microsoft.*</CompanyName> 
       </Exclude> 
      </CompanyNames> 

      <!-- Match the public key token of a signed assembly: --> 
      <PublicKeyTokens> 
       <!-- Exclude Visual Studio extensions: --> 
       <Exclude> 
       <PublicKeyToken>^B77A5C561934E089$</PublicKeyToken> 
       <PublicKeyToken>^B03F5F7F11D50A3A$</PublicKeyToken> 
       <PublicKeyToken>^31BF3856AD364E35$</PublicKeyToken> 
       <PublicKeyToken>^89845DCD8080CC91$</PublicKeyToken> 
       <PublicKeyToken>^71E9BCE111E9429C$</PublicKeyToken> 
       <PublicKeyToken>^8F50407C4E9E73B6$</PublicKeyToken> 
       <PublicKeyToken>^E361AF139669C375$</PublicKeyToken> 
       </Exclude> 
      </PublicKeyTokens> 


      <!-- We recommend you do not change the following values: --> 
      <UseVerifiableInstrumentation>True</UseVerifiableInstrumentation> 
      <AllowLowIntegrityProcesses>True</AllowLowIntegrityProcesses> 
      <CollectFromChildProcesses>True</CollectFromChildProcesses> 
      <CollectAspDotNet>False</CollectAspDotNet> 

      </CodeCoverage> 
     </Configuration> 
     </DataCollector> 
    </DataCollectors> 
    </DataCollectionRunSettings> 
</RunSettings> 

测试任务日志(法国):

2016-10-18T07:54:21.4325873Z Exécution du script PowerShell : C:\agent\tasks\VSTest\1.0.32\VSTest.ps1 
2016-10-18T07:54:21.5107118Z ##[debug]Calling Invoke-VSTest for all test assemblies 
2016-10-18T07:54:21.6669608Z Working folder: C:\agent\_work\4 
2016-10-18T07:54:21.6669608Z Executing C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe "C:\agent\_work\4\s\EDM 1-dev\Programs and Components\API\Archimed.Edm.Tests\bin\Release\Archimed.Edm.UnitTests.dll" /Settings:"C:\Users\TFSBUILD\AppData\Local\Temp\tmpAE1E.tmp" /EnableCodeCoverage /logger:trx /TestAdapterPath:"C:\agent\_work\4\s" 
2016-10-18T07:54:21.8700845Z Microsoft (R) Test Execution Command Line Tool Version 14.0.25123.0 
2016-10-18T07:54:21.8700845Z Copyright (c) Microsoft Corporation. Tous droits réservés. 
2016-10-18T07:54:22.2138323Z Démarrage de l'exécution du test, veuillez patienter... 
2016-10-18T07:54:27.4169240Z Informations : NUnit Adapter 3.4.1.0: Test execution started 
2016-10-18T07:54:27.4325489Z Informations : Running all tests in C:\agent\_work\4\s\........\bin\Release\UnitTests.dll 
2016-10-18T07:54:28.9169144Z Informations : NUnit3TestExecutor converted 1265 of 1265 NUnit test cases 
... Tests 
2016-10-18T07:55:44.9787034Z Informations : NUnit Adapter 3.4.1.0: Test execution complete 
... Tests 
2016-10-18T07:55:45.5724420Z Fichier de résultats : C:\Users\TFSBUILD\AppData\Local\Temp\TestResults\tfsbuild_TFSBUILD-GED 2016-10-18 09_54_31.trx 
2016-10-18T07:55:45.5724420Z Pièces jointes : 
2016-10-18T07:55:45.5724420Z C:\Users\TFSBUILD\AppData\Local\Temp\TestResults\eb407547-19e7-4485-8b35-44f8e51f344e\tfsbuild_TFSBUILD-GED 2016-10-18 09_54_24.coverage 
2016-10-18T07:55:45.5724420Z Nombre total de tests : 1265. Réussite : 1241. Échec : 0. Ignorés : 0. 
2016-10-18T07:55:45.5724420Z Test correctement exécuté. 
2016-10-18T07:55:45.5724420Z Délai d'exécution des tests : 1,3805 Minutes 
2016-10-18T07:55:45.6974396Z Publication des résultats des tests... 
2016-10-18T07:55:46.1505559Z ##[warning]Échec de la publication des résultats des tests : La valeur de la propriété startDate ne fait pas partie des valeurs admises pour cette dernière. 
+0

你可以分享你的详细设置的相关两个测试任务? –

+0

您可以共享该任务的构建日志吗? –

回答

0

我没有任何改变,任务设置或TFS设置。 现在,它工作。我不明白。