in

Platinum Bay

Peace, Love, and Visual Studio ALM

This Blog

Syndication


.NETicated

Unit Test Deployment Woes

One of the common complaints I hear about Unit Testing in Visual Studio centers around test deployment. By default, when you run a unit test, the assemblies get copied to another location to be run. The assemblies and test results are copied to the following folders:

    <Users Documents>\Visual Studio 2008\Projects\<Project Name>\Test Results

There are then subfolders based on the username, computer name, date and time, and further sub-folders representing the inputs and outputs of the test(s).

For most scenarios, this behavior is transparent and doesn't cause problems. If your assembly has dependencies however, unit tests can fail as the dependencies are not deployed automatically. You can attach deployment dependencies by double-clicking the LocalTestRun.testrunconfig file in the solution root, going to the Deployment tab, and adding any necessary files or directories that should be deployed with the assembly.

But this is a bunch of extra work, and can be viewed as 'friction' by some. Fortunately, there is another option. Many of the folks who complain about the deployment feature of Unit Tests point to NUnit as having an option to turn deployment on or off.

As it turns out, Unit Tests have the same option, and it was right under my nose the whole time. In the same Deployment tab, there is a checkbox at the top titled "Enable Deployment". By un-checking this options, you can tell the test framework not to deploy assemblies to another location before running the unit tests.

If you would like to make non-deployment the default option, you can modify the LocalTestRun.testrunconfig file in the "C:\Program Files\Microsoft Visual Studio 9.0\Team Tools\Testing Tools\TestProjectCommon\Templates\RunConfig\1033" directory by changing the Deployment node to:

    <Deployment enabled="false" />

There is one caveat however; code coverage, remote execution, and device test projects all require deployment, so turning it off will disable this functionality.

Comments

September 3, 2008 6:07 AM

Pingback from  Dew Drop - September 3, 2008 | Alvin Ashcraft's Morning Dew

 

September 8, 2008 5:18 AM

Willy-Peter Schaub on Team Foundation Server 2008 in Action: Review (Part 2 of 5) Steve Andrews on Unit...

 

May 21, 2010 6:44 AM

Pingback from  E550 Comprehensive Crossword Solver Anagram, E Class Tdi E550

 

May 22, 2010 2:49 AM

Pingback from  Rx350 Used Arizona Lexus Es350, Cargo Liners For Lexus Es350

 

May 22, 2010 12:26 PM

Pingback from  Buy Ford E 450 Econoline F350 Bronco Ii, Ford F350 Super Duty For Sale Turbo Diesel Kelley Blue Book

 

May 23, 2010 3:13 AM

Pingback from  Headlight Oem 2005 Suzuki Xl7, Xl7 Used Autos

 

May 23, 2010 3:15 AM

Pingback from  Intrepid Eads, Intrepid Travel Review Off The Beaten Track

 

May 24, 2010 11:30 AM

Pingback from  Cheap Raptor 350, 350 Cid Engine - 349.eumreborn.com

 

May 24, 2010 2:34 PM

Pingback from  Clk320 Sold 2002 Mercedes Benz, Clk320 Part Catalog 2005 Mercedes Clk63 Amg - 5.myipgirl.com

 

May 24, 2010 10:08 PM

Pingback from  Used Sw2 Parts Automatic Transmissions Saturn Sc2 Coupe, Sdr Sw20 Aufl?sung - 422.rkwrh.com

 

May 25, 2010 5:13 AM

Pingback from  Precis Bulbapedia Det, Precis Globe Providing - 245.eumreborn.com

 

May 25, 2010 7:57 AM

Pingback from  Fury Miniature, 68 3 Fastback 1973 Plymouth Fury - 456.jeepsunlimted.com

 

May 25, 2010 6:45 PM

Pingback from  C240 Wiki, Mercedes Benz C240 Part Turn Signal - 11.defutbolazo.com

 

May 25, 2010 7:41 PM

Pingback from  Mx 5 Miata Used Mazda, Mazda Miata Rear Brake Pads - 228.luna-atra.net

 

May 26, 2010 2:23 AM

Pingback from  12655 Ventura Boulevard, Hitachi Cp X265 Projector - 67.tijuanareader.com

 

May 31, 2010 6:02 AM

Pingback from  1981 - 2003 @ Rsx Ground Effects Razzi, Best Wide Angle Compacts - 171.luna-atra.net

 

May 31, 2010 6:13 AM

Pingback from  1980 - 1991 @ Grand Prix Legends Forum, Swiss Legend White Ceramic Watch Black Mother Of Pearl - 345.myipgirl.com

 

May 31, 2010 7:46 AM

Pingback from  1996 - 1988 @ Dvd Cirrostratus Get, Trish Stratus Weasel Randy Orton - 469.animejin.com

 

May 31, 2010 6:57 PM

Pingback from  1992 - 1989 @ Commercial Willys Knight, 1959 Willys Overland Wagon - 246.akemet.com

 

Leave a Comment

(required )  
(optional )
(required )  
Add

About Steve

Steve Andrews is an independent consultant, INETA speaker, and Microsoft MVP for Visual Studio ALM. He has been working in technology for over ten years focusing on custom application development and Application Lifecycle Management. Steve is also Microsoft and IBM certified and a community fanatic having led sessions at nearly 100 events across North America. When he's not developing software solutions or engaging with the community about software technology, Steve is a closet singer and songwriter and plays the guitar and keys. Occasionally, Steve even gets to sleep. Occasionally.
Powered by Community Server (Commercial Edition), by Telligent Systems
© Platinum Bay | Some Rights Reserved Creative Commons License

Disclaimer: The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Feel free to challenge me, disagree with me, or tell me I'm completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or annonymous comments) - so keep it polite, please.