Monday, August 19, 2019

TFS - How to run Unit Test in TFS Build

This blog demonstrates step by step how to add unit test task in TFS build definition and run unit test from TFS build so that code only be deployed once all unit test are passed.

Here is TFS Build definition

TFS Build Definition
TFS Build Definition
  

In TFS Build Definition, the following steps are defined

1.   Get source code from specified branch
2.   Set assembly manifest data
3.   Build Source Code
4.   Publish the artifact of Built Source to respective staging folder 


Now we want to add Unit Test Task in TFS build definition so that we can able to run unit test from TFS build.

Microsoft provides Visual Studio Test Task which help us to run test with visual studio test runner from TFS build.

By using this Visual Studio Test in a build or release pipeline, we can also run functional tests (Selenium, Coded UI Tests and more) using the Visual Studio Test Runner 
 TFS - Visual Studio Test Task



Add Visual Studio Task:

TFS - Visual Studio Test Task

No comments:

SQL Server - Identify unused indexes

 In this blog, we learn about the index usage information (SYS.DM_DB_INDEX_USAGE_STATS) and analyze the index usage data (USER_SEEKS, USER_S...