Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Team Services - Release Management cannot locate tests

When using the Visual Studio Test task in Release Management, the release always returns:

No test assemblies found matching the pattern

currently Test Assembly is set to: **\*test*.dll;-:**\obj\**

I have tried multiple defaults like $(System.DefaultWorkingDirectory), etc.

The documentation I've been able to find is either not current with the existing layout of tasks, (such as the Publish Build Artifacts screen no longer containing the Contents box), is for the on premise Visual Studio 2015, or related specifically to the Build.

I've read and attempted the following:

  • https://msdn.microsoft.com/Library/vs/alm/Release/getting-started/deploy-to-azure
  • https://msdn.microsoft.com/Library/vs/alm/Release/author-release-definition/understanding-tasks
  • https://msdn.microsoft.com/en-us/library/gg265783.aspx#Activity_RunTests
  • http://blogs.msdn.com/b/visualstudioalm/archive/2015/07/31/dev-test-in-azure-and-deploy-to-production-on-premises.aspx
  • http://blogs.msdn.com/b/visualstudioalm/archive/2015/05/29/testing-in-continuous-integration-and-continuous-deployment-workflows.aspx

UPDATE: I added a step to the build to Copy and Publish the test.dlls. They are now located. They all fail, due to missing other code, but they are located.

UPDATE II: My 3_Run_Tests.log file contains the following clues:

Error calling Initialization method for test class ... To run tests that interact with the desktop, you must set up the test agent to run as an interactive process.

Test Run deployment issue: The assembly or module ... directly or indirectly referenced by the test container ... was not found.

Because of the above, I am going to accept @eddie-msft's answer.

like image 470
Joshua Drake Avatar asked Jan 05 '16 17:01

Joshua Drake


1 Answers

You need to make sure that the complied file of the project which you'd like to test is also been copied and published to the same path with Test Assembly. The test will fail if only Test Assembly is copied.

I assume you are working on a C# project, in the step to copy test assembly, you can set the copy content as this:

**\YourTestProjectName\bin\$(BuildConfiguration)
like image 139
Eddie Chen - MSFT Avatar answered Nov 04 '22 10:11

Eddie Chen - MSFT