0

I'm unable to get my SpecFlow Tests to run from a build in TFS 2015. This appears to be similar to the issue mentioned in

SpecFlow + VSTS/TFS 2015 SpecFlow + VSTS/TFS 2015

The Answer given here did not solve my problem. I added $(Build.SourcesDirectory)\packages To my Path to Custom Test Adaptors and got an error:

Error: The path 'D:\vNextBuildAgent\1_work\b5a9c222\Platform\packages' specified in the 'TestAdapterPath' is invalid. Error: The custom test adapter search path provided was not found, provide a valid path and try again. VSTest Test Run failed with exit code: 1

Is (Build.SourcesDirectory) a pre-defined variable, a variable I need to set in my build definition, or something else? Is there another solution to this problem?

Community
  • 1
  • 1
Be-All
  • 91
  • 1
  • 1
  • 12

1 Answers1

0

Build.SourcesDirectory is a predefined variable, which is the local path on the agent where your source code files are downloaded.

In the link you provide, $(Build.SourcesDirectory)\packages is an example, you need to specify where in Source Control your "packages" folder lives.

Path to Custom Test Adaptors is the path to any custom or third-party test adapters for the framework for which the tests are written.

  • Supports a wide range of test frameworks such as NUnit, xUnit, Mocha, and Jasmine
  • Automatically searches subfolders.
  • Automatically scans any packages folder and installs and uses any NuGet packages containing test adapters without prompting.
  • Example: $(Build.SourcesDirectory)\Fabrikam\packages
Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39
  • If I didn't have access to my build machine, and couldn't see my packages folder, nuget packages, or customer test controller in TFS Source Control, is there a way I could determine what the correct path is? – Be-All Mar 02 '17 at 13:32
  • If there is a packages folder in the sources directory, it is automatically searched for testadapters. Hence, any testadapter downloaded as a Nuget package will be used without any input. Otherwise, you need to indicate the path for the test adaptor. – Cece Dong - MSFT Mar 03 '17 at 03:02
  • Without access to brows the build server's file system, you can add temporary debug PowerShell script steps into your build definition with filtered Get-ChildItem calls to determine the presence of your packages.. – The Furious Bear Feb 27 '20 at 17:08