MSTEST caching

5 posts, 0 answers
  1. David
    David avatar
    45 posts
    Member since:
    Aug 2010

    Posted 22 Dec 2011 Link to this post

    The webapp I am testing requires logging in to the application. I force every test to log in using a test I created and then insert in to every test as a "Test as Step"; it is the first test step in all of my tests.

    My login test includes another test "envrionmentswitch.tstest". This test allows me to switch between my environments by hand (soon to be programmatic). The chain of tests in my test app structure is:
    envrionmentswitch.tstest
    login.tstest
    <functional test>.tstest

    At one time, I had named "envrionmentswitch.tstest" as "envrionment switch.tstest" (see the space between words). MSTEST is still trying to reference "envrionment switch.tstest" (with the space) when executing my functional test. However, because that file no longer exists the test fails immediately. I get the error:
    Warning: Test Run deployment issue: Failed to get the file for deployment item '..\..\common\environment switch.tstest' specified by the test '<testname>':System.IO.DirectoryNotFoundException: Could not find a part of the path 'E:\CruiseControl\Automation\common\environment switch.tstest'.

    Is there a way I can clear the MSTEST cache? I have searched for the answer online and cannot seem to find anyone with a similar issue.
  2. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 22 Dec 2011 Link to this post

    Hello David,

    Thank you for the detailed description. I was able to reproduce the issue, but I don't believe it's related to MSTest.

    When you rename a test that is used as a Test as Step, the actual file name changes and the Test as Step reference is visually updated in the Test as Step's description within the master test. The change seems to still be "in memory," however, and not persisted to disk in association with the master test. If you run MSTest at this point, the master test will still point to the old file name.

    To update the Test as Step reference, the master test must be saved so the change "takes." You may need to create a Solution file for the project so you can save after a file renaming. When I ran MSTest after saving, it found the sub-test and executed successfully.

    Greetings,
    Anthony
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. David
    David avatar
    45 posts
    Member since:
    Aug 2010

    Posted 23 Dec 2011 Link to this post

    Anthony,
    Thanks for the direction. 

    I made and then removed a change and re-saved the master test in VS2010. When I checked in my code to CruiseControl and then built and executed the test through MSTEST I get the same error.

    I should have mentioned that I am executing MSTEST in a different environment. Sorry for the omission. I hope that moves this along a little further.

    Of course, running this test in VS2010 in my development environment works fine.
  4. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 28 Dec 2011 Link to this post

    Hi David,

    Are you running the test with a custom settings file as described in this article(step11). I'm getting the same error if I uncheck "Unable deployment" from the Deployment settings. Please read this KB article on "How to Enable Deployment" and see whether this is the case. 

    If this doesn't help, please send us the ccnet.config file and the generated .trx result file, so we can look further into this.  

    Kind regards,
    Plamen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. David
    David avatar
    45 posts
    Member since:
    Aug 2010

    Posted 28 Dec 2011 Link to this post

    Hi Plamen,
    I don't have any testsettings files in my project. I do have them in my directory but they are not a part of my test project.

    This error does not happen with every test, only some of them. I will start a support ticket to submit files for further information.
Back to Top
  Cast Your Vote at DevPro Connections! Cast Your Vote at  Win IT Pro Connections!