tfs build vnext 无法发布测试结果

Tfs build vnext cannot publish test results

我有一个带有 2 个测试步骤的 TFS Build Vnext 过程(还有,解决方案构建,...但这不是问题所在) 一个测试步骤用于单元测试,另一测试步骤用于集成测试。

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

但是,对于单元测试的步骤,TFS 无法发布结果,我在构建输出中有这个警告:

Failed to publish test results: The value of startDate is not part of the allowed values.

直到我打开测试结果文件 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 不会影响节点 Times 中属性 start 的正确值。 为什么?
我有大约 80 个集成测试和大约 1400 个单元测试,这是单元测试的数量吗?还是别的?

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

技术信息: 测试框架:

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

测试任务配置(两个测试任务的配置相同):

运行设置文件:

<?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.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
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\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\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\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.

我没有更改任何内容,任务设置或 tfs 设置。 现在,它正在工作。没看懂。