1

I am trying to run my acceptance tests in Visual Studio Team System (VSTS) after deploying the code to a website. The deployment has been working months. The test step is failing with the following message:

Here is the log:

##[section]Starting: Test Assemblies **\*acceptance.tests.dll;-:**\obj\** ============================================================================== Task : Visual Studio Test Description : Run tests with Visual Studio test runner Version : 2.0.24 Author : Microsoft Corporation Help : [More Information] (https://go.microsoft.com/fwlink/?LinkId=835764) ============================================================================== !**\obj\** [command]"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "d:\a\r1\a\Build website\drop\HepC.Web.Acceptance.Tests.dll" /logger:trx Microsoft(R) Test Execution Command Line Tool Version 14.0.25420.1 Copyright(c) Microsoft Corporation.All rights reserved. Starting test execution, please wait... Warning: No test is available in d:\a\r1\a\Build website\dropdll.Make sure that installed test discoverers & executors, platform & framework versionnd try again. Information: Additionally, you can try specifying '/UseVsixExtensions' command if the is installed on the machine as vsix extensions and your installation supports vsix .console.exe myTests.dll /UseVsixExtensions:true ##[warning]No results found to publish. ##[section]Finishing: Test Assemblies **\*acceptance.tests.dll;-:**\obj\** 

I am using NUnit 3 however the NUnit adapter has not been packaged up as part of the deployment so it can't see it. What is the best way to resolve this? It seems a bit odd to package NUnit3TestAdapter as part of the main website just so I can run some tests after deployment.

2 Answers 2

2

You need to include NUnit3TestAdapter package to the artifacts that used by release, then specify Path To Custom Test Adapters (/TestAdapterPath parameter for VSTest.console.exe) for Visual Studio Test step/task.

I recommend you do test during the build, if tests are passed, then publish web package to artifact, then you just need to do deployment during the release

  1. Install NUnit 3 test adapter package to your test project and check in changes
  2. Add Nuget install step/task to restore package
  3. Visual Studio Build step/task to build solution
  4. Visual Studio Test step/task (specify Path to Custom Test Adapters, for example: $(Build.SourcesDirectory)\packages)
  5. Publish Artifact

If you want to do test during the release, you can add Copy file step/task to copy adapter package to staging folder (Build.StagingDirectory) to include the adapter package in the artifact, then specify Path to Custom Test Adapters for Visual Studio Test task with that adapter package.

Sign up to request clarification or add additional context in comments.

3 Comments

I was told I didn't need to do this during build as VSTS automatically searches package restore locations. In fact I do this for my unit tests. I am specifically trying to run my acceptance tests which require the solution to be deployed first. I will try your second suggestion.
@johnstaveley I'm having this same issue, did you come to a resolution?
Yes, they worked for a while and then stopped again. Too busy to fix right now :(
0

I typically break out the artifacts when building:

  • Application
  • Tests
  • Deployment

Application is the actual binaries for the application to be deployed.

Tests contains the integration/functional tests (if any) that need to be run post-deployment and any associated stuff (test configs, test adapters, whatever)

Deployment contains deployment scripts and generalized config files to be transformed at deployment time.

In the scenario you're describing, the NUnit test adapter would be part of the test project, and you'd publish all of the binaries for that project (including the test adapter) to a set of test artifacts.

1 Comment

Have you got some sample config? My build settings are this: /p:OutDir=$(build.stagingDirectory) /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true This is the only way I could get it to package and deploy. I think it builds it into a single package

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.