3

I have some MSTest unit tests that are running just fine on my machine but are failing in my autobuild.

The error gives a generic fault exception then says "See the inner exception for details".

Normally I would just run the test then examine the inner exception. But it is working fine on my machine.

Is there a way to tell the tests to record the inner exception test too? Or do I have to log on to my build machine and try to run the tests from there? (Not really a great solution in my opinion.)

Vaccano
  • 78,325
  • 149
  • 468
  • 850
  • Have you looked in the published test result? Does it show nothing? – John Saunders Nov 30 '11 at 18:48
  • Personally, I would indeed run then test interactively on the build machine myself (what's wrong with that?). Where did you get the error displayed; in the test result window itself or by clicking the link stating "test run error" at the top left corner on the test results screen? – kroonwijk Nov 30 '11 at 19:57
  • @John I click on the test results link in the TFS build and it opens them up in Visual Studio. I then right clicked on the failed test(s) and selected the test details option. (Is that Published Test results?) – Vaccano Nov 30 '11 at 20:51
  • @kroonwijk - I am fine to run the tests on the build server. But the server takes a lot longer to run Visual Studio (it is not as powerful a machine). It would be nice to not have to do that when it gets an error. (Like authentication of Integration Test database calls.) – Vaccano Nov 30 '11 at 20:52

1 Answers1

0

I'm not aware of any method to get the exception after a test has failed.

You could always use a logger to log the exceptions that occur and write them to a file or mail them to you so you get all the details you need.

Or you could (temporarily) wrap your unit test in a try/catch -> throw and write the InnerException to your test outcome.

Wouter de Kort
  • 39,090
  • 12
  • 84
  • 103