0

I have some hundreds of tests and running with vstest. After completing the test run for all tests then only getting the .trx file. I wish to show the progress of test run for each test. I would not like to wait for all the test to complete.Once the test is completed, then I would like to show the progress

When I run multiple tests with vstest.console.exe, it is generating .trx file at the end of all tests run. So I will be not able to get the immediate information once the test is completed.

I hope that before writing to the .trx file, the results related to the test run might be stored in some repository based on the test run id and finally the details are retrieved and then written on the .trx file once the test run gets completed. Please correct me if i am wrong.

If this is true then how it can be queried from the repository to get the results before the .trx file gets generated?

My expectation is to show the test progress for each and every test like below:

No.OfTestsPassed/TotalNo.OfTests and

No.OfTestsFailed/TotalNo.OfTests

Amittai Shapira
  • 3,749
  • 1
  • 30
  • 54
Anil
  • 21
  • 1
  • 6
  • welcome to Stackoverflow! You may want to have a look at the following question, which have some more info on executing vstest.console.exe: https://stackoverflow.com/questions/39367263/how-to-enable-vstest-console-exe-logging – Amittai Shapira Jul 24 '19 at 13:23

1 Answers1

0

I think your best solution would be writing your own logger. If you take a look at trx logger source code you will see, that it writes results after TestRunComplete event has been raised. You can override it's default behavior, and write result file every time TestResult event is triggered.

You can see some examples how you can do that in TeamCityLogger: How to use custom logger for vs test?

Peska
  • 3,980
  • 3
  • 23
  • 40