Running Unit Tests in DevOps Pipeline - No tests found

Craig Muckleston 161 Reputation points
2020-10-05T08:29:00.03+00:00

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:
30096-image.png

and a VsTest Task:
30075-image.png

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

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
39,314 questions
{count} votes

Accepted answer
  1. Leon Laude 85,791 Reputation points
    2020-10-05T12:18:53.427+00:00

    Hi,

    Azure DevOps is currently not supported in the Q&A forums, the supported products are listed over here https://learn.microsoft.com/en-us/answers/products (more to be added later on).

    You may ask the subject matter experts in the dedicated Azure DevOps forum over here:
    https://developercommunity.visualstudio.com/spaces/21/index.html

    ----------

    (If the reply was helpful please don't forget to upvote or accept as answer, thank you)

    Best regards,
    Leon

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.