TFS 2015 RC Build.Preview Execute xUnit Tests

1.1k views Asked by At

We are trying to get xUnit tests to run properly using TFS 2015 RC. We're trying to access the test runner stored in our solutions NuGet packages folder which lives in our Build Agent's drop folder.

We are trying to reference the test runner using this path in the "Path to Custom Test Adapters" $(Build.SourcesDirectory)\WebIZ\packages\xunit.runners.1.9.2\tools.The build is able to resolve the path okay (it was failing before with an invalid path message), but now it cannot find the test runner

2015-06-09T20:05:40.4008595Z Executing the powershell script: D:\TFS\Build_vNext\AgentSchlitz\agent\tasks\VSTest\1.0.8\VSTest.ps1

2015-06-09T20:05:41.9947507Z Warning: The path 'D:\TFS\Build_vNext\AgentSchlitz\1c692895\WebIZ\WebIZ\packages\xunit.runners.1.9.2\tools\' specified in the 'TestAdapterPath' does not contain any test adapters, provide a valid path and try again. extensions. Example: vstest.console.exe myTests.dll /UseVsixExtensions:true

What should the proper configuration be for the "Path to Custom Test Adapters"? Should the proper configuration be: $(Build.SourcesDirectory)\WebIZ\packages\xunit.runners.1.9.2\tools* $(Build.SourcesDirectory)\WebIZ\packages\xunit.runners.1.9.2\tools*

4

There are 4 answers

0
DaveShaw On

I think you need to use XUnit 2.0 with the Nuget based runners.

There are full instructions in this blog post by Esteban Garcia that goes though the process step by step.

There's too much information and images for me to copy any one bit into this answer as the question is quite broad.

0
Christian Phillips On

I had tried all combinations with the same issue, what fixed this for me was adding the entry to the packages.config for the test project...

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="NUnit" version="3.5.0" targetFramework="net45" />
  <package id="NUnit3TestAdapter" version="3.5.0" targetFramework="net45" />
</packages>

Even though I had referenced the Nunit3Adapter in the project and solution, the last entry there in the config needed to be manually added.

0
sliderhouserules On

Are you sure that it isn't that you're simply pointing at the tools\ folder instead of the bin\ folder?

e.g.

Path to Custom Test Adapters: "$(Build.SourcesDirectory)\WebIZ\packages\xunit.runners.1.9.2\bin"


Also, if you're copying that path from a blog post or other source that uses non-standard double quotes, you'll get the path is invalid error. Just retype the double quotes directly in the input box or whatever to make sure you have "raw" double quotes.

0
Quantumplation On

In our XUnit configuration, our "path to custom test adapters" is to the solution directory, NOT the xunit custom adapters, and it finds it fine. We actually submitted this pull request: https://github.com/Microsoft/vso-agent-tasks/pull/222 to get the path to custom test adapters treated like a route, and not like a string. Making the same change on your server might help. We have no other custom settings:

Settings