TFS test cases - get most recent run outcome

1.3k Views Asked by At

How to query Test Cases that have been run and to identify if the most recent run passed or failed ?

we are using TFS2015 on premises, also configured SQL reporting server lately.

1

There are 1 best solutions below

2
On

Since you are using SQL reporting, you could create a SSRS report which will hold the value of all the test case results, execution date, who ran it. There are some related tables in Warehouse DB which stores the information. Each time test case outcome change, will create a test run, you could order by TestRunId: You just need to write a sample query to check the data. For example:

select TestCaseId,TestRunId, ResultOutcome,ResultDate from [dbo].[TestResultView] 
where TestCaseId = 'xxx' order by TestRunId,ResultDate

another similar query:

SELECT [ResultSK],[ResultBK],[ResultId],[TestCaseId],[Outcome]  FROM [Tfs_Warehouse].[dbo].[DimTestResult] 
where TestCaseId ='xxx'  order by DateCompleted

You could also user TFS REST API to git a list of test result based on test run ID, detail API please refer this--Get a list of test results.