I am running:
My tests are gated on build and unit tests. On my build box I have found the following folder: C:\Builds\4\SolutionName\SolutionName\TestResults, but sadly it is empty. I would like to find and parse the test result files. I would like to know what serves up the results of the build and how to call that from a third party tool. Does anyone know?
At end of section, you'll see detail like below which shows location of the .trx (test result file):
Results file: C:\Source\TestResults\tfsbuild_PMBUILD7 2013-08-05 08_32_02_Any CPU_Release.trx Test Settings: Default Test Settings
Waiting to publish...
Publishing results of test run tfsbuild@PMBUILD7
2013-08-05 08:32:02_Any CPU_Release to
http://pmtfs:8080/tfs/DefaultCollection...
....Publish completed successfully.
It will probably depend on your MSBuild/MSTest settings, especially for a gated build (which might do all kinds of things differently), but hopefully something in the following may at least offer you some clues...
The test results are usually dropped into the server's build folder (not the drop folder, but in the working folder in which the MSBuild process stores and builds all your source code, etc), using datestamped filenames for each of the test runs you have executed.
However it sounds like your folder is empty, which indicates that either you are looking in the wrong place (If you're doing a gated build, it may be that it uses a different working folder than a regular build, possibly alongside the C:\Builds\4 folder), or test results are not being generated (disabled or failing).
I'd try to find the build log as it'll almost certainly tell you what happened to the tests and if/where any results were written.
If you can locate the test results files, then you can usually just double click the main test results file to load the test results into Visual Studio (for display in the test results user interface) - so programatically you should be able to just Process.Start(testResultsFilename)
to launch Visual Studio to view the results (as long as VS is installed on the computer you're using your tool on).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With