This is a migrated thread and some comments may be shown as answers.

MSTEST caching

4 Answers 112 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David
Top achievements
Rank 1
David asked on 22 Dec 2011, 07:45 PM
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.

4 Answers, 1 is accepted

Sort by
0
Anthony
Telerik team
answered on 23 Dec 2011, 12:46 AM
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.
0
David
Top achievements
Rank 1
answered on 23 Dec 2011, 06:48 PM
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.
0
Plamen
Telerik team
answered on 28 Dec 2011, 05:39 PM
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.
0
David
Top achievements
Rank 1
answered on 28 Dec 2011, 10:22 PM
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.
Tags
General Discussions
Asked by
David
Top achievements
Rank 1
Answers by
Anthony
Telerik team
David
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or