Running unit tests on Team Foundation Server (TFS) builds

后端 未结 3 1050
攒了一身酷
攒了一身酷 2020-12-13 19:17

What are the steps to get Team Foundation Server running unit tests when a given build runs?

What are the caveats / pitfalls / workarounds a dev or sysadmin should

3条回答
  •  不思量自难忘°
    2020-12-13 20:14

    it depends on which version of TFS you are running, so I will assume it is 2008.

    Firstly, you must have Team Edition for Testers installed on the computer that will act as your build agent, as stated in How To: Create a Build Definition

    There are a couple of ways to tell Team Build to run tests for your build.

    1. Unit tests can be run from a defined Test List within the Solution being built. This list is referenced by the build definition and all tests within the chosen list(s) are executed. More info here
    2. WildCard test exectution is also available by defining a wildcard mask (i.e. Test*.dll) that instructs Team Build to run any tests present in assemblies that match the mask. This is done when defining the build definition as well.

    Things to note:

    If you intend to use the wildcard method and want to enable code coverage for your test configuration, you must add the following to your build definition file to enable it.

    $(SolutionRoot)\TestRunConfig.testrunconfig
    

    See my previous question on this for more info here

提交回复
热议问题