jeudi 18 janvier 2018

Where could I get the number of existing unit tests

I like to to get the numbers of unit tests in each build which was running in the last year. So that I could see if that the developers write some new tests.

For that I get a view to the TFS warehouse database and find the view TestResultView which exactly gives me the data which I need.

Query example:

SELECT BuildId, YEAR(ResultDate) as year, MONTH(ResultDate) as month , DAY(ResultDate) as day, COUNT() AS Passed, 0 AS Failed FROM TestResultView WHERE BuildDefinitionName = 'Test' AND TestResultAttributesOutcome = 'Passed' GROUP BY BuildId, YEAR(ResultDate), MONTH(ResultDate), DAY(ResultDate) UNION ALL SELECT BuildId, YEAR(ResultDate) as year, MONTH(ResultDate) as month, DAY(ResultDate) as day, 0 as Passed, COUNT() AS Failed FROM TestResultView WHERE BuildDefinitionName = 'Test' AND TestResultAttributesOutcome = 'Failed' GROUP BY BuildId, YEAR(ResultDate), MONTH(ResultDate), DAY(ResultDate)

The only problem is that I only see the last 4 days.

Do I use the wrong view, database or is there any other way to get this information?

Thanks much for your help.

Aucun commentaire:

Enregistrer un commentaire