I am having trouble running my Unit Tests from my DevOps task. It's just not finding any to run.
I have a build step that builds the solution. I then have a Copy Task:
and a VsTest Task:
When the Pipeline runs, my Copy Task output is as follows:
Copy Files:
Copying D:\a\1\s\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.Reactive.Testing.dll to $(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.Reactive.Testing.dll
Copying D:\a\1\s\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll to $(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll
Copying D:\a\1\s\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll to $(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll
Copying D:\a\1\s\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll to $(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll
Copying D:\a\1\s\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.TestFramework.dll to $(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.TestFramework.dll
Copying D:\a\1\s\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll to $(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll
Copying D:\a\1\s\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\testhost.dll to $(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\testhost.dll
Finishing: Copy Files to: $(ArtifactStagingDirectory)
And my VsTest Task output:
2020-10-04T09:21:13.0293576Z Microsoft (R) Test Execution Command Line Tool Version 16.7.0
2020-10-04T09:21:13.0344300Z Copyright (c) Microsoft Corporation. All rights reserved.
2020-10-04T09:21:13.0610137Z vstest.console.exe "D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.Reactive.Testing.dll"
2020-10-04T09:21:13.0612115Z "D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll"
2020-10-04T09:21:13.0613102Z "D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll"
2020-10-04T09:21:13.0614402Z "D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll"
2020-10-04T09:21:13.0615381Z "D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll"
2020-10-04T09:21:13.0616352Z "D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.TestFramework.dll"
2020-10-04T09:21:13.0617154Z "D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\testhost.dll"
2020-10-04T09:21:13.0617764Z /Settings:"D:\a_temp\40s4tyfvwn1.tmp.runsettings"
2020-10-04T09:21:13.0618109Z /Logger:"trx"
2020-10-04T09:21:13.0618532Z /TestAdapterPath:"D:\a\1\s\$(ArtifactStagingDirectory)"
2020-10-04T09:21:16.3225578Z Starting test execution, please wait...
2020-10-04T09:21:17.2747460Z Test run will use DLL(s) built for framework .NETFramework,Version=v4.0 and platform X86. Following DLL(s) do not match framework/platform settings.
2020-10-04T09:21:17.2748541Z Microsoft.Reactive.Testing.dll is built for Framework .NETCore,Version=v5.0 and Platform AnyCPU.
2020-10-04T09:21:17.2749784Z Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll is built for Framework .NETPortable,Version=v4.5,Profile=Profile259 and Platform AnyCPU.
2020-10-04T09:21:17.2750816Z Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll is built for Framework .NETPortable,Version=v4.5,Profile=Profile259 and Platform AnyCPU.
2020-10-04T09:21:17.2751832Z Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll is built for Framework .NETCore,Version=v5.0 and Platform AnyCPU.
2020-10-04T09:21:17.2752714Z Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll is built for Framework .NETCore,Version=v5.0 and Platform AnyCPU.
2020-10-04T09:21:17.2754784Z Microsoft.VisualStudio.TestPlatform.TestFramework.dll is built for Framework .NETPortable,Version=v4.5,Profile=Profile259 and Platform AnyCPU.
2020-10-04T09:21:17.2755614Z testhost.dll is built for Framework .NETStandard,Version=v1.4 and Platform AnyCPU.
2020-10-04T09:21:17.2756323Z Go to http://go.microsoft.com/fwlink/?LinkID=236877&clcid=0x409 for more details on managing these settings.
2020-10-04T09:21:17.5372701Z A total of 7 test files matched the specified pattern.
2020-10-04T09:21:18.3190191Z [MSTest][Discovery][D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.Reactive.Testing.dll] Failed to discover tests from assembly D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.Reactive.Testing.dll. Reason:File does not exist: D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.Reactive.Testing.dll
2020-10-04T09:21:18.3192561Z [MSTest][Discovery][D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll] Failed to discover tests from assembly D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll. Reason:File does not exist: D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll
2020-10-04T09:21:18.3196756Z [MSTest][Discovery][D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll] Failed to discover tests from assembly D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll. Reason:File does not exist: D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll
2020-10-04T09:21:18.3199260Z [MSTest][Discovery][D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll] Failed to discover tests from assembly D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll. Reason:File does not exist: D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll
2020-10-04T09:21:18.3201414Z [MSTest][Discovery][D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll] Failed to discover tests from assembly D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll. Reason:File does not exist: D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll
2020-10-04T09:21:18.3204706Z [MSTest][Discovery][D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.TestFramework.dll] Failed to discover tests from assembly D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.TestFramework.dll. Reason:File does not exist: D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.TestFramework.dll
2020-10-04T09:21:18.3209768Z [MSTest][Discovery][D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\testhost.dll] Failed to discover tests from assembly D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\testhost.dll. Reason:File does not exist: D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\testhost.dll
2020-10-04T09:21:19.6328836Z No test is available in D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.Reactive.Testing.dll D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\Microsoft.VisualStudio.TestPlatform.TestFramework.dll D:\a\1\s\$(ArtifactStagingDirectory)\MyProject_sln\MyProject.TestsUWP\bin\x64\Debug\testhost.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
2020-10-04T09:21:19.7739145Z Results File: D:\a_temp\TestResults\VssAdministrator_WIN-H6MO5BKS61H_2020-10-04_09_21_19.trx
2020-10-04T09:21:19.8152897Z Vstest.console.exe exited with code 0.
2020-10-04T09:21:19.8154009Z **************** Completed test execution *********************
2020-10-04T09:21:19.8272927Z Test results files: D:\a_temp\TestResults\VssAdministrator_WIN-H6MO5BKS61H_2020-10-04_09_21_19.trx
2020-10-04T09:21:19.8805299Z No Result Found to Publish 'D:\a_temp\TestResults\VssAdministrator_WIN-H6MO5BKS61H_2020-10-04_09_21_19.trx'.
2020-10-04T09:21:20.2679560Z Created test run: 1000048
2020-10-04T09:21:20.2683520Z Publishing test results: 0
2020-10-04T09:21:20.3778514Z Publishing test results to test run '1000048'.
2020-10-04T09:21:20.3821063Z TestResults To Publish 0, Test run id:1000048
2020-10-04T09:21:20.3821560Z Published test results: 0
2020-10-04T09:21:20.3834030Z Publishing Attachments: 1
2020-10-04T09:21:21.5662553Z Completed TestExecution Model...
2020-10-04T09:21:21.6112661Z ##[section]Finishing: VsTest - testAssemblies
No tests are running though