Michael Stephenson

keeping your feet on premise while your heads in the cloud
posts - 256, comments - 277, trackbacks - 11

My Links

News

View Michael Stephenson's profile on BizTalk Blog Doc View Michael Stephenson's profile on LinkedIn

Twitter












Archives

Post Categories

Image Galleries

BizTalk

Mates

Calling MsTest from MsBuild with multiple test containers

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]

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Print | posted on Friday, April 27, 2007 10:13 AM | Filed Under [ BizTalk .net 2 MsBuild ]

Feedback

Gravatar

# re: Calling MsTest from MsBuild with multiple test containers

A nice explanation. Thanks a lot, this was just what I needed.
12/14/2010 4:25 AM | Nacho
Gravatar

# re: Calling MsTest from MsBuild with multiple test containers


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.
12/31/2010 12:07 AM | SY0-201 dumps
Gravatar

# re: Calling MsTest from MsBuild with multiple test containers


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.

12/31/2010 12:08 AM | 642-813 dumps
Gravatar

# re: Calling MsTest from MsBuild with multiple test containers

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.
1/4/2011 10:47 PM | Notebook
Gravatar

# re: Calling MsTest from MsBuild with multiple test containers

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".
1/13/2011 1:22 AM | testking 70-536
Gravatar

# re: Calling MsTest from MsBuild with multiple test containers

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.
1/13/2011 1:24 AM | testking 70-653
Gravatar

# re: Calling MsTest from MsBuild with multiple test containers

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.
2/22/2011 5:35 AM | Testking
Gravatar

# re: Calling MsTest from MsBuild with multiple test containers

This is a great blog with excellent posts and links.
Thanks for sharing.
4/5/2011 5:53 AM | flower france
Gravatar

# lia james

Your work is very good and I appreciate you and hopping for some more informative posts. Thank you for sharing great information to us.
4/12/2011 3:05 AM | send mothers day flowers South A
Gravatar

# Tech Reviews

This is a good test to do..Thanks for explaining us how to do it
5/14/2011 5:11 AM | Professional Technology reviews
Gravatar

# re: Calling MsTest from MsBuild with multiple test containers

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.
9/17/2011 1:04 AM | Golf Sunglasses Uk
Gravatar

# re: Calling MsTest from MsBuild with multiple test containers

Cheap Sports sunglasses, we provide sports sunglasses in various designs and colors for men and women athletes in uk.
9/17/2011 1:05 AM | Sports Sunglasses
Gravatar

# re: Calling MsTest from MsBuild with multiple test containers

Native eyewear, we provide native sunglasses online which are very famous among people in the fashion world.
9/17/2011 1:05 AM | Native Sunglasses
Gravatar

# re: Calling MsTest from MsBuild with multiple test containers

cheap digital cameras, we provide online Olympus, Canon, Sony, Nikon and Kodak digital camera and accessories at company rate in UK.
9/17/2011 1:07 AM | Mini Digital Camera
Gravatar

# re: Calling MsTest from MsBuild with multiple test containers

Review Kauai vacation rentals online and get lowest prices on homes, condos and cottages and best locations in Kauai's top resorts.
9/17/2011 1:08 AM | Kauai Vacation
Gravatar

# re: Calling MsTest from MsBuild with multiple test containers

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
9/26/2011 8:06 PM | Infinity Tower
Gravatar

# re: Calling MsTest from MsBuild with multiple test containers

Thanks for this post! I got the answer I was looking for!
10/12/2011 9:09 AM | TDN
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: