Team Foundation Server 2015 TestCategory not working - tfs

TFS 2015 is calling tests that do not have the "Dev" test category.
TFS Build has a Visual Studio Build and Visual Studio Test step. The Test step has TestCategory=Dev set in the Test Filter criteria.
Test Class
[TestMethod]
[TestCategory("Dev")]
public void AllOrderItems() {
//Assertions here.....
}
Log Results
2016-05-17T18:11:07.5722452Z ##[debug]Entering script VSTest.ps1
2016-05-17T18:11:07.5732446Z ##[debug]vsTestVersion = 14.0
2016-05-17T18:11:07.5732446Z ##[debug]testAssembly = **\*tests*.dll;-:**\obj\**
2016-05-17T18:11:07.5742465Z ##[debug]testFiltercriteria = TestCategory=Dev
...
2016-05-17T18:11:08.1743177Z Executing C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe "C:\TestAgentWork\35\s\APP.Business.Tests\bin\APP.Business.Tests.dll" "C:\TestAgentWork\35\s\APP.Business.Tests\bin\Test\APP.Business.Tests.dll" "C:\TestAgentWork\35\s\APP.Models.Tests\bin\Debug\APP.Models.Tests.dll" "C:\TestAgentWork\35\s\APP.Models.Tests\bin\APP.Models.Tests.dll" "C:\TestAgentWork\35\s\APP.Models.Tests\bin\Test\APP.Models.Tests.dll" "C:\TestAgentWork\35\s\APP.Web.Tests\bin\APP.Web.Tests.dll" "C:\TestAgentWork\35\s\APP.Web.Tests\bin\Test\APP.Web.Tests.dll" /TestCaseFilter:"TestCategory=Dev" /logger:trx
...
2016-05-17T18:11:10.6976251Z ##[error]Error Message:
2016-05-17T18:11:10.6976251Z ##[error] Assert.IsTrue failed.
2016-05-17T18:11:10.6986243Z ##[error]Stack Trace:
2016-05-17T18:11:10.6996235Z ##[error] at APP.Business.Tests.BusinessLayerTests.CheckIfCertifierSignatureOnFile() in C:\TestAgentWork\35\s\APP.Business.Tests\BusinessLayerTests.cs:line 516
2016-05-17T18:11:10.6996235Z Failed CheckIfCertifierSignatureOnFile
I've also tried priority=1 and added [Priority(1)] as an attribute on the test method with the same results.
TFS Version 14.95.25122.0

Just tested with TFS 2015 Update2, Test Filter Criteria worked as expected. Please make sure your TFS has upgraded to the latest edition.
Also, the error message "Assert.IsTrue failed" indicates the issue is due to your test methods, you may check them.

Related

TFS 2018 - Building pre-release packages

I'm using "TFS 2018 Update 2" and trying to build a package marked as a pre-release according to the microsoft semantic
I tried using the .nuspec file inserting the (ex: 1.0.0-beta and changing the Build number format as: $(BuildDefinitionName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)$(Suffix)
setting the $(Suffix) variable at queue time.
Every attempt failed: the package never contains the suffix, than is never marked as pre-release.
I see that the nuget pack command never contains the suffix (missing "-beta" after "2018.6.12.9"). In my test build $Suffix is set to "-beta":
nuget.exe pack
C:\agent_work\4\s\DotNetClassicLibrary\DotNetClassicLibrary.csproj
-NonInteractive -OutputDirectory C:\agent_work\4\a -Properties Configuration=debug -version 2018.6.12.9 -Verbosity Detailed
The Build task on TFS is:
"DotNetClassicLibrary / Build DotNetClassicLibrary_2018.6.12.9-beta /
Job / NuGet pack"
So I'm sure that the variable is assigned because of the presence of the suffix "-beta" in the path.
Here there is the configuration of the nuget pack task
This is the Build number format
I could reproduce your scenario on my side. In my opinion, Nuget pack task with build number doesn't support character or numbers. You may check this task and try to modify it.
case "byBuildNumber":
tl.debug("Getting version number from build number")
if(tl.getVariable("SYSTEM_HOSTTYPE") === "release")
{
tl.setResult(tl.TaskResult.Failed, tl.loc("Error_AutomaticallyVersionReleases"));
return;
}
let buildNumber: string = tl.getVariable("BUILD_BUILDNUMBER");
tl.debug(`Build number: ${buildNumber}`);
let versionRegex = /\d+\.\d+\.\d+(?:\.\d+)?/;
let versionMatches = buildNumber.match(versionRegex);
if (!versionMatches)
{
tl.setResult(tl.TaskResult.Failed, tl.loc("Error_NoVersionFoundInBuildNumber"));
return;
}
if (versionMatches.length > 1)
{
tl.warning(tl.loc("Warning_MoreThanOneVersionInBuildNumber"))
}
version = versionMatches[0];
break;
As an alternative, you could choose Nuget custom, and specify the
pack command there with parameter -version $(Build.BuildNumber),
I've tried on my side, this works.

Test build step in TFS 2017 does not appear to run

I have been setting up build configurations in TFS 2017.
As part of the build configuration I have Test steps.
When the build runs the test steps seems to run without error.
I committed some code in with a test I set to fail, to make sure that TFS stopped the build in the event tests fail. I queued a new build and then surprisingly the build completed with no issue.
I am having this issue on full framework libraries, that are being packaged into NuGet packages and also having it with .net core projects.
On evaluating the log for the test step I see the following messages.
These are from a .Net Core build
The build log
The build step for a core project
These ones are from a full framework build config
The build log for full framework
##[section]Starting: Test Assemblies **\*test*.dll;-:**\obj\**
==============================================================================
Task : Visual Studio Test
Description : Run tests with Visual Studio test runner
Version : 1.0.85
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?LinkId=624539)
==============================================================================
Preparing task execution handler.
Executing the powershell script: c:\agent\_work\_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\1.0.85\VSTest.ps1
Testing container: 'REGISTRY::HKEY_CLASSES_ROOT\CLSID\{177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D}'
Exists.
Adding Visual Studio setup helpers.
Getting Visual Studio setup instances.
Found 2 instances.
Description : Supports running automated tests and load tests remotely
DisplayName : Visual Studio Test Agent 2017
Id : 0f053fb9
InstallDate : System.Runtime.InteropServices.ComTypes.FILETIME
Name : VisualStudio/15.2.0+26430.6
Path : C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent
Version : 15.0.26430.6
VersionString : 15.0.26430.6
Description : Microsoft DevOps solution for productivity and coordination
across teams of any size
DisplayName : Visual Studio Enterprise 2017
Id : e4f83d45
InstallDate : System.Runtime.InteropServices.ComTypes.FILETIME
Name : VisualStudio/15.4.0+27004.2002
Path : C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise
Version : 15.4.27004.2002
VersionString : 15.4.27004.2002
Testing leaf: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe'
Exists.
Working folder: c:\agent\_work\11\s
Executing C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe "c:\agent\_work\11\s\*******.EDI\*******.EDI.Tests\bin\Release\*******.EDI.Tests.dll" "c:\agent\_work\11\s\*******.EDI\*******.EDI\packages\FluentAssertions.4.19.4\lib\sl5\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\cs\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\cs\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\cs\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\de\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\de\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\de\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\es\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\es\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\es\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\fr\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\fr\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\fr\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\it\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\it\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\it\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ja\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ja\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ja\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ko\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ko\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ko\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pl\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pl\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pl\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pt\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pt\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pt\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ru\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ru\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ru\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\tr\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\tr\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\tr\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\netstandard1.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\uap10.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\dotnet\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\dotnet\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\uap10.0\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\uap10.0\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll" /EnableCodeCoverage /logger:trx /TestAdapterPath:"c:\agent\_work\11\s"
Microsoft (R) Test Execution Command Line Tool Version 15.0.26228.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
Warning: Using Isolation mode to run the tests as diagnostic data adapters were enabled in the runsettings. Use the /inIsolation parameter to suppress this warning.
Warning: Unable to load types from the test source 'c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\uap10.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll'. Some or all of the tests in this source may not be discovered.
Warning: Input string was not in a correct format.
Warning: Input string was not in a correct format.
Warning: Input string was not in a correct format.
Warning: Input string was not in a correct format.
Warning: Input string was not in a correct format.
Warning: Unable to load types from the test source 'c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll'. Some or all of the tests in this source may not be discovered.
Warning: No test is available in c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\tr\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ru\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\tr\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ru\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ru\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\tr\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\uap10.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\netstandard1.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pt\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\dotnet\Microsoft.VisualStudio.TestPlatform.TestFramework.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\dotnet\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.TestFramework.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\uap10.0\Microsoft.VisualStudio.TestPlatform.TestFramework.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\uap10.0\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pt\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pl\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\cs\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\cs\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\cs\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\de\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\de\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\de\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\es\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\es\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\es\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\fr\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\fr\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\fr\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pt\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\it\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\it\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ja\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ja\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ja\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ko\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ko\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ko\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\Microsoft.VisualStudio.TestPlatform.TestFramework.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pl\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pl\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\it\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll c:\agent\_work\11\s\*******.EDI\*******.EDI.Tests\bin\Release\*******.EDI.Tests.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll c:\agent\_work\11\s\*******.EDI\*******.EDI\packages\FluentAssertions.4.19.4\lib\sl5\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.
Attachments:
c:\agent\_work\11\s\TestResults\e806ae8a-20fe-40d7-956e-90b827a56c83\Dwainwright_ASSODOPDV01 2017-10-23 15_39_33.coverage
Information: Additionally, you can try specifying '/UseVsixExtensions' command if the test discoverer & executor is installed on the machine as vsix extensions and your installation supports vsix extensions. Example: vstest.console.exe myTests.dll /UseVsixExtensions:true
##[warning]No results found to publish.
##[section]Finishing: Test Assemblies **\*test*.dll;-:**\obj\**
The Build Step for full framework
How can i set up TFS so that the tests are actually ran, and more so, the build stops if any test fails.
Further info:
I have VS 2017 installed on the build server too.
The tests are written in NUnit. Not sure if something else needs adding to the build server. Almost looks as though the build server is trying to use MSTest; i see some references to MSTestAdapter
VSTest task cannot run .NET core tests as it uses the Test platform version 1. To run .NET core tests, we recommend using the .NET core task with the test command.
Reference https://github.com/Microsoft/vsts-tasks/issues/5066
As a workaroun you can manually invoke vstest.console.exe from folder C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\TestPlatform\ and provide /Framework:FrameworkCore10.
C:\Program Files (x86)>dir vstest.console.exe /s
Volume in drive C is Windows
Volume Serial Number is 0835-B24B
Directory of C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Com
mon7\IDE\CommonExtensions\Microsoft\TestWindow
10/24/2017 02:55 PM 137,824 vstest.console.exe
1 File(s) 137,824 bytes
Directory of C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Com
mon7\IDE\Extensions\TestPlatform
09/04/2017 12:09 PM 133,240 vstest.console.exe
1 File(s) 133,240 bytes
Reference https://github.com/Microsoft/vstest/issues/579#issuecomment-339263411
UPDATE:
Make sure you are not missing and dependancies.
Check the packages.config, it should be similar as below:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MSTest.TestAdapter" version="1.1.11" targetFramework="net452" />
<package id="MSTest.TestFramework" version="1.1.11" targetFramework="net452" />
</packages>

How do I make the mstest results available from the TFS build page?

I have a build workflow (xaml) that invokes mstest. My expectation is that there would be a link to the test results available on the build summary page. However, this is not the case.
The build ends with the MSTest command - exits with 1, since there are failures. So, MSTest is the last activity in the workflow.
Something is definitely wrong here. The drop location contains just the workflow logs - no test results. These are found in the TestResults folder, but not in the drop location.
So, my question is - how do I need to wire the MSTest activity so that at the end there would be a link somewhere to the test results?
Now the gory details. This is how the last moments of the workflow look like in the activity log (I replaced some stuff with [...] for the sake of brevity). Notice the following message at the end:
Publishing results of test run tfsbuild#TORSVARCH01 2017-03-02 16:03:43_Any CPU_Release to http://tfsserver:8080/tfs/defaultcollection...
................Publish completed successfully.
But where is it published?
MSTest
Inputs
TestLists:
ToolPath:
TestNames:
MinPriority: -1
TestSettings:
CommandLineArguments:
SearchPathRoot: d:\b\test\3269\..\2282\Binaries
Platform: Any CPU
MaxPriority: -1
Category:
RunTitle:
PathToResultsFilesRoot: d:\b\test\3269\..\2282\TestResults
TestContainers: System.Linq.Enumerable+WhereEnumerableIterator`1[System.String]
TestMetadata:
TestConfigName:
Flavor: Release
TestConfigId: -1
Publish: True
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\MSTest.exe /nologo /usestderr /searchpathroot:"d:\b\test\3269\..\2282\Binaries" /resultsfileroot:"d:\b\test\3269\..\2282\TestResults" /testcontainer:"d:\b\test\2282\Binaries\BackgroundJobTests.dll" [...] /publish:"http://tfsserver:8080/tfs/defaultcollection" /noprompt /publishbuild:"vstfs:///Build/Build/265747" /teamproject:"DFDev" /platform:"Any CPU" /flavor:"Release"
Loading d:\b\test\2282\Binaries\BackgroundJobTests.dll...
[...]
Starting execution...
Warning: The disabled test 'GetJobReqModels' was removed from the test run.
Results Top Level Tests
------- ---------------
Passed BackgroundJobTests.AsyncParallelSqlRunnerTest.AsyncExceptionInDoIt
[...]
Passed WFMCommonTest.TimesheetApi.UnitTests.TimeSegmentApiTests.Test_RoundTimeOfOneSegment
1778/5035 test(s) Passed, 3224 Failed, 33 Error
Summary
-------
Passed 1778
Failed 3224
Error 33
------------
Total 5035
Results file: d:\b\test\2282\TestResults\tfsbuild_TORSVARCH01 2017-03-02 16_03_43_Any CPU_Release.trx
Test Settings: Default Test Settings
Test Run Error.
Run has the following issue(s):
Warning: Test Run deployment issue: The assembly or module 'dtSearchNetApi2' directly or indirectly referenced by the test container 'd:\b\test\2282\binaries\ruleenginetests.dll' was not found.
[...]
Warning: Test Run deployment issue: The assembly or module 'System.ServiceModel.Web' directly or indirectly referenced by the test container 'd:\b\test\2282\binaries\utilitytest.dll' was not found.
One of the background threads threw exception:
System.Data.OleDb.OleDbException (0x80004005): Cannot open database "851qa89" requested by the login. The login failed.
[...]
One of the background threads threw exception:
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
[...]
Waiting to publish...
Publishing results of test run tfsbuild#TORSVARCH01 2017-03-02 16:03:43_Any CPU_Release to http://tfsserver:8080/tfs/defaultcollection...
................Publish completed successfully.
Exception Message: MSTest.exe returned an exit code of 1 indicating that not all tests passed. (type TestFailureException) Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities
EDIT 1
We are using TFS 2015. The build template is a custom one.
The mstest command line parameters can be observed from the aforementioned sample, but here they are again broken one per line for convenience:
/nologo
/usestderr
/searchpathroot:"d:\b\test\3269\..\2282\Binaries"
/resultsfileroot:"d:\b\test\3269\..\2282\TestResults"
/testcontainer:"d:\b\test\2282\Binaries\BackgroundJobTests.dll" ...
/publish:"http://tfsserver:8080/tfs/defaultcollection"
/noprompt
/publishbuild:"vstfs:///Build/Build/265747"
/teamproject:"DFDev"
/platform:"Any CPU"
/flavor:"Release"
The d:\b\test\2282\TestResults folder indeed contains the trx file and an auxiliary directory. But that is not good enough - I want to seem them online. And mstest claims they are published:
Publishing results of test run tfsbuild#TORSVARCH01 2017-03-02 16:03:43_Any CPU_Release to http://tfsserver:8080/tfs/defaultcollection...
................Publish completed successfully.
But what is the address?
EDIT 2
I checked the online summary page of the build and the test results link is there, but it is not found on the summary page that one can view in the Visual Studio.
Please, observe the page I can see in the Visual Studio 2015:
Now the same page when accessed through a browser. Notice the hyperlink to the test on the right side of the page:
So, I suppose my question can be narrowed down to how can one see this link on the build summary page in Visual Studio?
EDIT 3
Here is my almost entire build workflow - http://pastebin.com/9z2UE79E
In order to save some space I removed two pieces:
An InvokeProcess activity to upgrade a database
An InvokeProcess activity to modify a certain config file.
I do not understand what do I have to do to include the Test Summary on the overall Summary page.
It seems you use the /publish option in MSTest activity. Use the /publish option to publish test data to the database for the team project collection associated with the project's Team Foundation Server.
Check: https://msdn.microsoft.com/en-us/library/ms243151(v=vs.120).aspx

TFS 2015 Build: Test results not being published

I'm having a really weird error when TFS 2015 executes an automated test step.
The results are generated, but it seems TFS unable to find them.
In the end, it just says that no results were found to publish (which is weird, because it even outputs the result full path)
Check below the build logs for more info:
2015-12-16T15:44:29.5816976Z Executing the powershell script: C:\TfsBuildAgents\VsoBuildAgent\tasks\VSTest\1.0.22\VSTest.ps1
2015-12-16T15:44:29.7066995Z ##[debug]Calling Invoke-VSTest for all test assemblies
2015-12-16T15:44:30.4723241Z Working folder: C:\TfsData\Build\_work\1
2015-12-16T15:44:30.4723241Z Executing C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe "C:\TfsData\Build\_work\1\s\Rx.Api.V2.Tests\bin\Rx.Api.V2.Tests.dll" /Settings:"C:\TfsData\Build\_work\1\s\Staging.runsettings" /EnableCodeCoverage /inIsolation /logger:trx
2015-12-16T15:44:30.7379639Z Microsoft (R) Test Execution Command Line Tool Version 14.0.24720.0
2015-12-16T15:44:30.7379639Z Copyright (c) Microsoft Corporation. All rights reserved.
2015-12-16T15:44:30.9567007Z Starting test execution, please wait...
2015-12-16T15:44:38.2067012Z Passed Login
2015-12-16T15:44:39.6129523Z Passed GetMyEndpoints
2015-12-16T15:44:39.6129523Z Passed GetEndpoint
2015-12-16T15:44:42.3648007Z Passed Impersonate
2015-12-16T15:45:23.0904977Z Passed SingleHotel_BookTwoPaxesOnSingleRoom
2015-12-16T15:45:50.8053379Z Passed SingleHotel_BookOnePaxOnSingleRoom
2015-12-16T15:46:20.5444670Z Passed SingleHotel_BookFourPaxesOnTwoRooms
2015-12-16T15:46:53.4013344Z Passed SingleHotel_BookFourPaxesOnFourRooms
2015-12-16T15:47:03.3137055Z Passed Location_BookOnePaxOnOneRoom
2015-12-16T15:47:03.5168256Z Results File: C:\TfsData\Build\_work\1\s\TestResults\LOCAL SERVICE_YODA 2015-12-16 15_44_38.trx
2015-12-16T15:47:03.5168256Z Attachments:
2015-12-16T15:47:03.5324554Z C:\TfsData\Build\_work\1\s\TestResults\46904440-50c9-4522-b3c8-a84356b83b27\LOCAL SERVICE_YODA 2015-12-16 15_44_33.coverage
2015-12-16T15:47:03.5324554Z Total tests: 9. Passed: 9. Failed: 0. Skipped: 0.
2015-12-16T15:47:03.5324554Z Test Run Successful.
2015-12-16T15:47:03.5324554Z Test execution time: 2.4823 Minutes
2015-12-16T15:47:03.6887046Z ##[warning]No results found to publish.
In your runsettings file, comment out the ResultsDirectory tag under the RunConfiguration section.

MSBuild never deploys no matter its arguments

This is related to a question I asked yesterday but is probably best asked separately.
I have a TFS 2010 server running a build of a .csproj file, and an IIS6 box with msdeploy installed on it. I want to get the build automatically published by the build, but it never tries to run the publish no matter what I send into its parameters. I can put DeployTarget=TotalCarp and it still runs without error, but does not attempt to publish.
Heres the section of log from the build that is relevant:
Run MSBuild for Project
Initial Property Values
AdditionalVCOverrides =
CommandLineArguments = /p:SkipInvalidConfigurations=true /p:DeployOnBuild=True /p:DeployTarget=TotalCarp /p:MsDeployPublishMethod=RemoteAgent /p:DeployIisAppPath="WebRoot/ExternalContractSupportWeb" /p:MsDeployServiceUrl=whatever /p:AllowUntrustedCertificated=True /p:UserName=Username /p:Password=Password
Configuration = Test
GenerateVSPropsFile = True
LogFile =
LogFileDropLocation = \g10svhudtfs\TFSBuilds\ExternalContractSupport\TestBuild\TestBuild_20101101.25\logs
MaxProcesses = 1
OutDir = C:\Builds\1\CustomerTerms\TestBuild\Binaries
Platform = Any CPU
Project = C:\Builds\1\CustomerTerms\TestBuild\Sources\ExternalContractSupportWeb\ExternalContractSupportWeb.csproj
ResponseFile =
RunCodeAnalysis = AsConfigured
Targets =
TargetsNotLogged = String[] Array
ToolPath =
ToolPlatform = Auto
Verbosity = Diagnostic
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe /nologo /noconsolelogger "C:\Builds\1\CustomerTerms\TestBuild\Sources\ExternalContractSupportWeb\ExternalContractSupportWeb.csproj" /m:1 /fl /flp:"logfile=C:\Builds\1\CustomerTerms\TestBuild\Sources\ExternalContractSupportWeb\ExternalContractSupportWeb.log;encoding=Unicode;verbosity=diagnostic" /p:SkipInvalidConfigurations=true /p:DeployOnBuild=True /p:DeployTarget=TotalCarp /p:MsDeployPublishMethod=RemoteAgent /p:DeployIisAppPath="WebRoot/ExternalContractSupportWeb" /p:MsDeployServiceUrl=whatever /p:AllowUntrustedCertificated=True /p:UserName=Username /p:Password=Password /p:OutDir="C:\Builds\1\CustomerTerms\TestBuild\Binaries\" /p:Configuration="Test" /p:Platform="Any CPU" /p:VCBuildOverride="C:\Builds\1\CustomerTerms\TestBuild\Sources\ExternalContractSupportWeb\ExternalContractSupportWeb.csproj.Any CPU.Test.vsprops" /dl:WorkflowCentralLogger,"D:\Program Files\Microsoft Team Foundation Server 2010\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Diagnostic;BuildUri=vstfs:///Build/Build/49;InformationNodeId=5798;TargetsNotLogged=GetNativeManifest,GetCopyToOutputDirectoryItems,GetTargetPath;TFSUrl=http://g10svhudtfs:8080/tfs/TFSCollection;"*WorkflowForwardingLogger,"D:\Program Files\Microsoft Team Foundation Server 2010\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Diagnostic;"
Everything I've found on the web has at least an error code but this looks as though its worked but is obviously making no attempt to even try and deploy anything?
I just looked at this more and this will be the behavior you get if the files at %Program Files32%\MSBuild\Microsoft\VisualStudio\v10.0\Web are not on the machine. The reason for this is because the Web Application Project imports the file <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> which is installed by Team Build, then that file contains the import <Import Project="..\Web\Microsoft.Web.Publishing.targets" Condition="Exists('..\Web\Microsoft.Web.Publishing.targets')" /> which contains the logic for the Web Publishing Pipeline (WPP). Which are the targets which read DeployTarget, BuildOnDeploy, etc. The fact that the import is conditional is the reason that you are not getting an error. I am going to ask the dev why its conditional.

Resources