问题
locally tests and works. but it does not see the tfs te on the server and it does not work. I can not see the xUnit test in Tfs and I can not work with it. TFS version 2017
--- Solition----
回答1:
For normal project, you could directly use Visual Studio Test task in the build pipeline.
You could try to explicitly specific the path to the xunit runner. Such as
$(System.DefaultWorkingDirectory)\packages\xunit.runner.visualstudio.2.2.0\build\_common)
And Szeki's comment is right, xUnit test runner can only be run in an assembly targeting .NET 4.5.2 or above, otherwise it cannot be loaded (and thus the tests will not be found). Take a look at this question: Running xunit.net tests in VSTS
If you are working with .net core project, you should use .net core command line to run the test instead of VStest. Details info please refer below blog:
- Publish Core XUnit Test Results in VSTS
- VSTS Configuration to run xUnit tests for x64 platform
来源:https://stackoverflow.com/questions/47546562/xunit-tests-do-not-appear-on-tfs