Running (x)Unit Tests on TFS Build Pipeline

梦想与她 提交于 2019-12-06 07:02:11

First make sure your build agent environment is as same as your local develop machine. Such as Visual Studio version, MsTestAdapter ,xunit runner version and so on.

You could double confirm this by manually run the test directly on the build agent machine not through TFS.

Then use the below tasks in your build pipeline:

  1. Add a dotnet restore task.
  2. Then a dotnet build task.
  3. Add a dotnet test task with the arguments --no-build --logger "trx;LogFileName=tests-log.trx
  4. Add a Publish test results task with the following settings

More details please refer this tutorial blog: Running dotnet core xUnit tests on Visual Studio Team Services (VSTS)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!