TFS Prem Release No test assemblies found matching

2019-08-19 01:53发布

问题:

I am trying to trigger tests to occur on our development environments servers. The tests do get performed on the build server, which has the Build Agent and Test Agent.

On Our development server I have installed

  • Test Agent
  • I found this line [command]powershell NonInteractive -ExecutionPolicy Unrestricted -file D:\TFSVSOWork_tasks So
  • I copied that directory to the development server as it didn't exist.
  • installed Chrome

I see in the log is

2019-07-11T20:11:46.5428863Z ##[section]Starting: VsTest - testAssemblies
2019-07-11T20:11:46.5428863Z ==============================================================================
2019-07-11T20:11:46.5428863Z Task         : Visual Studio Test
2019-07-11T20:11:46.5428863Z Description  : Run tests with Visual Studio test runner
2019-07-11T20:11:46.5428863Z Version      : 2.0.55
2019-07-11T20:11:46.5428863Z Author       : Microsoft Corporation
2019-07-11T20:11:46.5428863Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=835764)
2019-07-11T20:11:46.5428863Z ==============================================================================
2019-07-11T20:11:47.3085004Z Run the tests locally using vstest.console.exe
2019-07-11T20:11:47.3085004Z ========================================================
2019-07-11T20:11:47.3085004Z Test selector : Test assemblies
2019-07-11T20:11:47.3085004Z !**\obj\**
2019-07-11T20:11:47.3085004Z Test assemblies : **\*UITests*.dll,!**\obj\**
2019-07-11T20:11:47.3085004Z Test filter criteria : null
2019-07-11T20:11:47.3085004Z Search folder : D:\Applications\Http\xyz\test
2019-07-11T20:11:47.3241263Z Run settings file : D:\Applications\Http\Landing
2019-07-11T20:11:47.3241263Z Run in parallel : false
2019-07-11T20:11:47.3241263Z Run in isolation : false
2019-07-11T20:11:47.3241263Z Path to custom adapters : C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow
2019-07-11T20:11:47.3241263Z Other console options : null
2019-07-11T20:11:47.3241263Z Code coverage enabled : false
2019-07-11T20:11:47.3241263Z VisualStudio version selected for test execution : latest
2019-07-11T20:11:47.3241263Z [command]powershell -NonInteractive -ExecutionPolicy Unrestricted -file D:\TFSVSOWork\_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\2.0.55\vs15Helper.ps1
2019-07-11T20:11:48.2303716Z <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
2019-07-11T20:11:48.2303716Z   <S>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise</S>
2019-07-11T20:11:48.2303716Z </Objs>
2019-07-11T20:11:48.2303716Z [command]wmic datafile where "name='C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\vstest.console.exe'" get Version /Value
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z Version=15.0.28307.421
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z Version=15.0.28307.421
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z 
2019-07-11T20:11:48.3397476Z ========================================================
2019-07-11T20:11:48.3553717Z ##[warning]No test assemblies found matching the pattern: **\*UITests*.dll,!**\obj\**.
2019-07-11T20:11:48.3709967Z ##[section]Finishing: VsTest - testAssemblies

Its not Failing the task, meaning I get a green check. but I do get ##[warning]No test assemblies found matching the pattern: *UITests*.dll,!\obj**. Or is there other pieces of software that I need still to load.

回答1:

TFS Prem Release No test assemblies found matching the pattern: *UITests*.dll,!\obj\

By default we specify $(System.DefaultWorkingDirectory) as the search folder in the Visual Studio Test task. And this points to the Source folder on the Agent, which relevant to the directory where the Agent is installed.

But the search folder in your log is D:\Applications\Http\xyz\test, it seems the local folder on your TFS server. To resolve this issue, you should make sure you are instructing MSBuild (using the OutDir parameter) to output your assemblies to that specific location when you build the project then you can use that location.

Note: Since you test the assemblies at release, you should make sure those assemblies will not be cleaned up after the build is complete.

Update:

According to your Team Members`s error log, I found that following error message:

2019-07-18T18:27:43.9323329Z [command]"C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\Extensions\TestPlatform\vstest.console.exe" \\Servername\D$\FAF_Applications\Http\XYZAppName\test\XYZAppName.Nunit.UITests.dll /logger:trx "/TestAdapterPath:\"D:\TFSVSOWork\r45\a\"" /framework: .NetFramework,version=V4.7.2
2019-07-18T18:27:44.0417108Z Microsoft (R) Test Execution Command Line Tool Version 15.9.0
2019-07-18T18:27:44.1198351Z The /Framework argument requires the target .Net Framework version for the test run.   Example:  /Framework:".NETFramework,Version=v4.5.1"

It seems you are not give the correct grammar rule in your parameters:

/framework: .NetFramework,version=V4.7.2

It should be:

/Framework:".NetFramework,version=V4.7.2"

You are missing the double quotes and add more space in the parameters.

Hope this helps.