Add reporting to TFS

Learn how to add Perfecto Smart Reporting to TFS.

Group tests by job and build in the Report Library

To view tests grouped by continuous integration system job and build, you need to provide the job name and build number into reporting as system variables. This enables you to group your test executions in reporting first by job name and then by build number, providing you a complete overview of the build quality.

Add Job Name and Build Number parameters

Microsoft Team Foundation Server (TFS) provides some default variables. For the complete list of TFS variables, see here.
You can use TFS variables to provide the Job Name and Job Number parameters to Smart Reporting.

To access these variables, use the following format within your code: 

Copy
${variableName}

Instead of variableName, use BUILD_DEFINITIONNAME and BUILD_BUILDNUMBERto retrieve both and then pass them to the Reporting Client.

Supply Maven or Ivy parameters

If you are running your tests using Maven or Ivy, add the following JVM parameters and (optionally) the Report-tags parameter:

Copy
-Dreportium-job-name=${BUILD_DEFINITIONNAME} -Dreportium-job-number=${BUILD_BUILDNUMBER} -Dreportium-job-branch=${myBranch} -Dreportium-tags=${myTag}

You need to supply the myTag and myBranch values (see Add variables below). TFS automatically supplies the BUILD_DEFINITIONNAME and BUILD_BUILDNUMBER values.

To add CustomField pairs, use the following format:

Copy
-DReportiumCustomFields=customField1=value1,customField2=value2

Add variables 

TFS provides a way to inject variables and use them in your project using the User-defined variables tab within your build configuration.