Geeks With Blogs

News View Michael Stephenson's profile on BizTalk Blog Doc View Michael Stephenson's profile on LinkedIn
Michael Stephenson keeping your feet on premise while your heads in the cloud

Learnt something new with MsTest today… in the scripts I have for our projects we run the tests using MsTest from the command line as follows:

 

<Exec Command='"$(VS80COMNTOOLS)..\IDE\mstest.exe" /testcontainer:Acme\Group\BizTalk\Utilities\Tests\bin\$(ConfigurationName)\Acme.Group.BizTalk.Utilities.Tests.dll /runconfig:localtestrun.testrunconfig' />

 

<Exec Command='"$(VS80COMNTOOLS)..\IDE\mstest.exe" /testcontainer:Acme\Group\BizTalk\PipelineComponents\Tests\bin\$(ConfigurationName)\Acme.Group.BizTalk.PipelineComponents.Tests.dll /runconfig:localtestrun.testrunconfig' />

 

<Exec Command='"$(VS80COMNTOOLS)..\IDE\mstest.exe" /testcontainer:Acme\Group\BizTalk\Build\Tests\bin\$(ConfigurationName)\Acme.Group.BizTalk.Build.Tests.dll /runconfig:localtestrun.testrunconfig' />

 

<Exec Command='"$(VS80COMNTOOLS)..\IDE\mstest.exe" /testcontainer:Acme\Group\BizTalk\Testing\Tests\bin\$(ConfigurationName)\Acme.Group.BizTalk.Testing.Tests.dll /runconfig:localtestrun.testrunconfig' />

 

This will run out 4 test assemblies fine.  Ok so now I was interested in the code coverage aspect and getting the report into CruiseControl (more on this later) and I found a couple of things. 

 

1.             Each assembly is run completely seperately in different folders when it is tested

 

2.             There are 4 coverage reports, 1 for each assembly

 

This is really what you would expect, but in order to run the tests and get just one coverage file I needed to change the way I was calling MsTest.  Basically thanks to my collegue Callum Hibbert (who I always ask if I have a problem with anything Build or TFS related) I found that when calling MsTest you can specify multiple test containers an example of which would be as follows:

 

 <Exec Command='"$(VS80COMNTOOLS)..\IDE\mstest.exe" /testcontainer:Acme\Group\BizTalk\Utilities\Tests\bin\$(ConfigurationName)\Acme.Group.BizTalk.Utilities.Tests.dll /testcontainer:Acme\Group\BizTalk\PipelineComponents\Tests\bin\$(ConfigurationName)\Acme.Group.BizTalk.PipelineComponents.Tests.dll /runconfig:localtestrun.testrunconfig' />

 

(ive only specified 2 here to keep the example simpler but you can supply 4 in the same way)

 

This means when I now run the reports I have 1 folder containing all of the test stuff and also 1 test coverage file.

[As a side note on this we done have Team Suite or Team Test to use a test list]

 

Posted on Friday, April 27, 2007 10:13 AM BizTalk , .net 2 , MsBuild | Back to top


Comments on this post: Calling MsTest from MsBuild with multiple test containers

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
A nice explanation. Thanks a lot, this was just what I needed.
Left by Nacho on Dec 14, 2010 4:25 AM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...

This is nice blog.I recently came across your blog and have been reading along. I thought I would leave my first comment. I don’t know what to say except that I have enjoyed reading. Nice blog, I will keep visiting this blog very often.Thanks for nice info. It’s useful for me. Can you give me some more information with details? I will wait for your next post.
Left by SY0-201 dumps on Dec 31, 2010 12:07 AM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...

Hi
They’re both sentient beings, except that animal life is more valuable than Human life, so how can eating animals be any less appalling than eating Humans?And yes, I am aware that Humans are animals, so don’t bother pointing that out.

Left by 642-813 dumps on Dec 31, 2010 12:08 AM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
It's powered by a triple-core AMD Phenom II processor and the ATI Radeon HD 5650 graphics processor, which combines multi-core processing and powerful graphics for a superior digital entertainment experience. A Multi-Gesture Touchpad enables you to pinch, flick and swirl your fingers across the touchpad for more natural photo and video viewing as well as intuitive navigation of websites. Other features include ultra-fast Wireless-N Wi-Fi networking, an integrated webcam for video chats, and a SuperMulti optical drive that's compatible with double-layer DVD discs.
Left by Notebook on Jan 04, 2011 10:47 PM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
I've ran into this problem before as well, though during building and not automated test execution. My problem was the TFS build working directory where the skeleton of my project was being recreated for the build process was left as the default "$(Temp)\$(BuildDefinitionPath)". I solved this by moving it to just "d:\build".
Left by testking 70-536 on Jan 13, 2011 1:22 AM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
looks very similar to what we are doing – a lot of complexity in the build file that could be removed if this feature is implemented.
Left by testking 70-653 on Jan 13, 2011 1:24 AM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
This post is written in such a way that a reader that is very new to this subject will be able easily to understand all bits and pieces of it. That exactly what I experienced when I was reading it.
Left by Testking on Feb 22, 2011 5:35 AM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
This is a great blog with excellent posts and links.
Thanks for sharing.
Left by flower france on Apr 05, 2011 5:53 AM

# lia james
Requesting Gravatar...
Your work is very good and I appreciate you and hopping for some more informative posts. Thank you for sharing great information to us.
Left by send mothers day flowers South A on Apr 12, 2011 3:05 AM

# Tech Reviews
Requesting Gravatar...
This is a good test to do..Thanks for explaining us how to do it
Left by Professional Technology reviews on May 14, 2011 5:11 AM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
Cheap golf sunglasses, We are the best golf sunglasses company in uk which provide golf sunglasses online at cheap rates in wide variety of color and designs.
Left by Golf Sunglasses Uk on Sep 17, 2011 1:04 AM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
Cheap Sports sunglasses, we provide sports sunglasses in various designs and colors for men and women athletes in uk.
Left by Sports Sunglasses on Sep 17, 2011 1:05 AM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
Native eyewear, we provide native sunglasses online which are very famous among people in the fashion world.
Left by Native Sunglasses on Sep 17, 2011 1:05 AM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
cheap digital cameras, we provide online Olympus, Canon, Sony, Nikon and Kodak digital camera and accessories at company rate in UK.
Left by Mini Digital Camera on Sep 17, 2011 1:07 AM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
Review Kauai vacation rentals online and get lowest prices on homes, condos and cottages and best locations in Kauai's top resorts.
Left by Kauai Vacation on Sep 17, 2011 1:08 AM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
I think this post will be a fine read for my blog readers too, could you please allow me to post a link to my blog. I am sure my guests will find that very useful. Apartments to let in Dubai || Rent Villas in Dubai
Left by Infinity Tower on Sep 26, 2011 8:06 PM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
Thanks for this post! I got the answer I was looking for!
Left by TDN on Oct 12, 2011 9:09 AM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
Having read your post, I am really involved in the topic you want to tell me.
Left by Online buy propecia on Mar 08, 2012 4:59 AM

# nice post
Requesting Gravatar...
well, this is really a nice post.I really like the way you start and conclude your thoughts. Thank you so much for this information.
Left by essays writing on Jun 19, 2012 12:47 AM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
Could you please guide me how to run MSTest unit tests usiing a MSBuild script?
Thank you very much!
Left by academic writing service on Aug 17, 2012 5:24 AM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
Thanks for the valuable information and insights you have so provided here...
Left by translation company on Feb 23, 2013 9:45 AM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
I believe that its really very hard to understand that.I did not understand your tips and tutorial.So i will request to you write it with easily.Thats will be easy to understand us.
_____
ziang
Website: Auto transport Texas Inc
Location: Dallas, Texas
Left by movemein on Mar 15, 2015 6:19 PM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
nice post admin thanks for this. XENDER IS REALLY INTERESTING APP.
mobdro for Windows
xender download app
Left by mobdro tv app for pc on May 12, 2017 7:27 PM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
Thanks for the article regarding Calling MsTest from MsBuild with multiple test containers. I have been encountering some issue while trying to call functions from multiple test containers in MsBuild. I believe this could really be a great help for me. Would give a detailed review after trying this on my pc. http://mytabletrentals.com
Left by Taylor Shaw on Jul 25, 2017 11:19 PM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
Nice post, many thanks
vivalared Link to link 
Left by Vivalared on Sep 11, 2017 3:20 AM

# re: Calling MsTest from MsBuild with multiple test containers
Requesting Gravatar...
Left by maderas on Oct 27, 2017 11:14 PM

Your comment:
 (will show your gravatar)


Copyright © Michael Stephenson | Powered by: GeeksWithBlogs.net