force updating of test list RRS feed

  • Question

  • Hi,
    I'm using mstest to run unittests. I'm experiencing a problem where, after adding a new test method, running all tests (ctrl+r, a) does not include the recently written test method/s in the test list. This worked fine in vs2008. Restarting VS2010 seems to fix the problem, but I'd really like to know if there is some other way to force the list to reload without reopening VS.

    Thanks in advance for any insight on this.

    • Moved by Anutthara - MSFT Tuesday, November 17, 2009 2:19 PM (From:Visual Studio Team System 2010 Beta2)
    Wednesday, November 11, 2009 1:16 PM


All replies

  • If you build the project that should force the update.  We stopped auto updating based on code model changes due to some significant performance issues.  In addition if you open the test view there is a button to refresh it.
    Tuesday, November 17, 2009 3:31 PM
  • Hi Chris,
    thank you for your answer. However, it does not work when I build. Let me shed a little extra light on the problem. I've noticed that it behaves exactly as you say when I have only one test project in my solution. When I add a second test project to the solution, the problem starts occurring. Whenever I add a new test method the first project and rerun my tests, the new test is run as expected. But, when I add a new test method to the other test project it is not run, ie. the number of tests is not incremented and the test does not appear in the test results list. It does work if I clean the solution (Alt+b, Alt+c) and then run the tests (Ctrl+r, a). I have around 300 unit tests all in all in the two projects, I don't know if the amount of tests has anything to with it.

    Tuesday, November 24, 2009 10:37 AM
  • Hi Klaus,

    I suspect you're building only one of your projects. To build your whole solution, do ctrl+shift+b. That should update everything. Also if you open the Test View (Test menu | Test view window), and hit refresh, you should be able to see all tests in your solution show up there.

    Can you confirm this works?

    David Gorena Elizondo
    MSFT Visual Studio Team Test
    Wednesday, December 16, 2009 9:50 PM
  • David,
    As mentioned earlier, the problem only occurs when adding tests to one of the five test projects in my solution. The only difference between this project and the rest is that it has [AssemblyInitialize] and [AssemblyCleanup] methods. These methods are lengthy (taking 2-4 seconds) operations which basically setup and teardown a database. However I don't know if this is the cause of the problem or not, I'm just mentioning it should you guys feel like investigating the problem further.
    I can definitely live with the problem, I just wanted to be nice and report it since VS2010 is in beta and I thought you might want some feedback.
    I can understand if you deem it to be a low priority issue and in that case you can just close this question and take no further action. On the other hand, if you have an honest interest in investigating the problem, I will more than happy to provide you with help to reproduce the problem. But if you do I will expect your inquiries to go beyond questioning my ability to build a solution.

    Merry christmas,

    Thursday, December 17, 2009 9:14 AM
  • Hi Klaus,

    Sorry that it took me so long to reply. Please don't get me wrong; Visual Studio has so many features that sometimes what might seem like a complex problem can have a simple solution. I was just trying to make sure that this was not the case before trying to ask a lot of questions. I'm definitely interested in trying to isolate the problem and coming up with a repro.

    So, if you add that specific project to a brand new solution, do you still experience the bug?

    Would it be at all possible that you share your solution with me? If so, let me know and i'll send you an mailing address where you can send it.

    David Gorena Elizondo
    MSFT Visual Studio Team Test
    Friday, January 8, 2010 10:05 PM