We use xUnit to run tests using Visual Studio Test task after Visual Studio Build task. The solution is created on .NET Fw 4.6.2 and using xUnit version 2.4.1.

There is some kind of bug, that makes the Test run resulting in all tests GREEN, but resulting the task to Fail.

As a solution/workaround for the Visual Studio Test there can be specified a Path to custom test adapters property, targeting directly to Packages/xunit.runner.visualstudio.2.4.1/build/_common where the Framework testing dlls are placed.

So far so good - using that workaround gives a way to go.

As an improvement I wrote a PS script, that runs before the the Test task, setting a variable that I also use in the Visual Studio Test task - Path to custom test adapters. The script is about to set my custom variable "XunitRunnerFolder" to programmatically selected path.

The problem is, that athough the variable is correctly set in PS script (and confirmed by reading in an extra script that i added in between the PS and Test task), the Test task still shows the initial value of the "XunitRunnerFolder" instead of reading the current/changed one.

Recap:

  1. initial value of XunitRunnerFolder is "auto" (defined on Task Group input variables)
  2. PS script changes the XunitRunnerFolder variable to Packages/xunit.runner.visualstudio.2.4.1/build/_common, using ##vso[task.setvariable variable=XunitRunnerFolder;]xxx/Packages/xunit.runner.visualstudio.2.4.1/build/_common
  3. an extra script that reads the $Env:XunitRunnerFolder confirms its value is set to the (2.) value
  4. Visual Studio Test task has set in its property Path to custom test adapters the variable $(XunitRunnerFolder), but in its log it writes-out that the value is the initial one ("auto")

Is there, please, a way to solve this, resulting in correct use of the newly set value in Test task? Googling for 2 days so far didn't help, maybe because of not being native english speaker to ask correctly.

0

There are 0 best solutions below