Pergunta

I am trying to profile a single unit test (the test itself passes) using dotTrace 4.0. It seems that dotTrace profiles Resharper's test runner instead of profiling the test itself.

I could find an answer from JetBrains dev team regarding this issue with dotTrace 3.1: it seems that MSTest creates a new process for running tests, and it was a known limitation of dotTrace 3.1 that it could not handle this behaviour.

This behaviour of MSTest can be inhibited using the /noisolation option in command line, but it cannot be done from within the IDE.

This page here: http://confluence.jetbrains.net/display/NetProf/Profiling+Unit+tests+with+dotTrace+4.0 also tells me that using dotTrace 4.0 and ReSharper 5.0, it should work out-of-the box.

Which it does not.

So I tried to run the test from the standalone UI of dotTrace as explained in the above link, it actually does the trick but with limitations:

  • the described method runs all tests within a specified dll. The arguments used to launch the test could maybe be tuned to run one specific test, but it seems a lot of trouble for running just one tiny UT.
  • it seems all my source code is not attached to the session, which takes some more time to correct.

I went through VS options, ReSharper options, .testrunconfig options, without any luck. Anyone has solved this before?

Foi útil?

Solução

Actually there was an option in ReSharper that I had not seen: ReSharper > Options > Tools > Unit Testing > MSTest > Use this Test Run Configuration When I set this to default it runs just fine.

Something is wrong in my test configuration after all. I do not know what is wrong, since the only difference with default is that I have Deployment enabled with a few XML files that are used for a test project I am not using right now. And I do not understand either how that relates with my problem.

Anyway, since it works like this...

Outras dicas

This might have been caused by built-in code coverage which comes with Visual Studio. Please make sure it's turned off for your solution.

WBR, Oleg Stepanov JetBrains s.r.o. "Develop with pleasure!"

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top