As I mentioned last week, I am new to TDD. For better or worse, all of my tests (and spikes) have been generated via Visual Studio Test Projects. Working with VS Test Projects hasn’t been all that bad although I noticed a couple of annoyances right away.
Is anyone else bothered by the fact that, by default, an unlimited number of test results and binaries are “deployed?” If you are testing first, this arguably makes for a lot of useless activity and waste disk space. Since the default TestResults folder location is set to be side-by-side with your solution files, the extra folders, trx files and binaries can also really interfere with your otherwise easy source control check-ins.
Fortunately, there are ways to work around the excessive TestResults problem if you are running VS2008. Some options are available through the IDE and other require an update to the .testrunconfig file directly:
Limit the number of deployed tests:
Tools > Options > Test Tools > Test Execution > Test Results Management > Limit number of old Test Results to the value of your choosing.
The screen shot below sets the number of tests to one. Therefore all previous tests are purged and only the latest test is maintained.
Disable Test Result deployment:
If you wish to disable the Test Result generation completely, double-click on your solution’s .testrunconfig file and uncheck the “Enable deployment” option. No results will be generated thereafter.
Change the Test Result folder location:
This option is hidden. I don’t believe it is exposed in any of the VS 2008 dialogues and you have to edit the .testrunconfig file directly.
Right-click on the .testrunconfig file > Open With… > XML Editor > Include the following within the TestRunConfiguration node:
<Deployment useDefaultDeploymentRoot="false" userDeploymentRoot="C:\TestResults" />
I hope it helps.
References:
- http://arcware.net/archive/2007/12/09/Limit-the-Number-of-Old-Test-Results-with-VS2008.aspx
- http://blogs.msdn.com/nnaderi/archive/2007/05/11/new-unit-testing-features-in-orcas-part-1.aspx
- http://weblogs.asp.net/stephenwalther/archive/2008/03/19/tdd-test-driven-development-with-visual-studio-2008-unit-tests.aspx
- http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=3026907&SiteID=1
Thanks for these tips – these issues were driving me crazy! Cheers!
Thanks for the info on how to change the TestResults folder! That is exactly what I was looking for.
Can I use “relative path“ on userDeploymentRoot element?
I have a Blogger blog that is hooked up to my personal website. The actual blog is linked off of the homepage. I would like to know if there’s a widget or something that I can put on my website’s homepage that will show my latest blog posts. Not the whole post, but maybe just the headline and a link to go to my blog..
Hey! I could have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s new to me. Anyways, I’m definitely happy I found it and I’ll be bookmarking and checking back often!
I’d must grant with you on this. Which can be not one thing I usually do!
I prefer to read this style of things.
Thank you for sharing superb informations. Your website is very cool. I’m impressed by the details that you have on this blog. It reveals how nicely you understand this subject. Bookmarked this web page, will come back for more articles. You, my pal, ROCK! I found just the information I already searched everywhere and just couldn’t come across. What an ideal web-site.
Good youtube videos and article too
Merely wanna input on few general things, The website style is perfect, the subject material is real fantastic : D.
You’ve put together some great posts on here. I’ve bookmarked this, and will most definitely come back to see what you’ve written again.
there is a fantastic weblog here! would you want to produce some invite posts on my blog site?
Everything is very open with a clear explanation of the issues. It was really informative. Your site is extremely helpful. Thanks for sharing!
Very good written story. It will be valuable to anybody who utilizes it, including myself. Keep doing what you are doing – can’r wait to read more posts.
I have not checked in here for a while since I thought it was getting boring, but the last few posts are great quality so I guess I¡¦ll add you back to my everyday bloglist. You deserve it my friend
Great weblog right here! Additionally your site quite a bit up fast! What web host are you using? Can I am getting your associate hyperlink in your host? I want my site loaded up as quickly as yours lol