I have a process with TFS Build Vnext with 2 tests step (also, solution build, ... but that's not the problem) One test step is for unit tests and the other one for integration tests.
The step with integration tests is fine, no problem to publish tests in TFS at the end of the step, i have the charts in the build summary.
However, for the step with unit tests, TFS cannot publish the results, i have this warning in the build output :
Failed to publish test results: The value of startDate is not part of the allowed values.
I didn't understand why i had this output until I opened the test result file 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 does not affect a correct value for the attribute start in the node Times.
Why ?
I have ~80 integration tests and ~1400 units tests, is it the number of units tests ? or something else ?
I tried to delete the unit tests step and recreate it.
Technical informations : Test framework :
- Nunit 3.5.0 with Nunit VS Test Adapter 3.4.1
- TFS 2015 with all requirements met
- Task used : Visual Studio Test
For instance, i tried to downgrade Nunit to 3.4.1 to met the version with the adapter, it didn't change anything.
Test Task configuration (same configuration for both Test Tasks):
- Execution Options :
- Test Assembly : one assembly
- Run Settings File : see below
- Code Coverage Enabled : true
- Run in Parallel : true
- Advanced Execution Options :
- VSTest version : VS 2015
- Reporting Options :
- Platform : any cpu
- Configuration : Release
- Upload Test Attachments : true
RunSettings File :
<?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>
Test task logs (French) :
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.