How to Run Tests from MSBuild

Hi every one,
I am Running the Tests from MSBuild, and they are running fine. All the tests are executed either Pass / Fail.
I am using the exec command provided by MSBuild to run the MSTest.exe command.

There is one problem, after the tests are executed the error comes up
C:\master.proj(34,3): error MSB3073: The command "MSTest/TestCotainer:Testing1099.dll" exited with code 1.
I dont know what happens after the exec command, there is nothing after that.
May be a logical error, if someone can help me it would be appreciated.

Thanks
Sameer

[581 byte] By [SameerSeth] at [2008-1-3]
# 1
If you copy and pasted your mstest.exe command than it looks like you didn't put space between mstest and /testcontainer switch.

Thanks,
Bata Chadraa,
VSTT

bchadraaMSFT at 2007-9-25 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 2
Its again giving me the same error,
This is the command which i used
I tried both ways, but including space and excl. but no result.
<Exec Command = "MSTest /TestContainer:Testing1099.dll" workingdirectory="Testing1099\bin"/>

The tests execute fine, it also gives me the last statement which i get from Dos mode execution, but after that the error pops up .
Can you figure out the problem ?

Thanks
Sameer

SameerSeth at 2007-9-25 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 3
Are you saying that tests are executed but command returns exit code 1? If your tests have failing test then that would be expected exit code from mstest.exe process. If that is not the case and mstest.exe process is not executing at all then can you try using complete paths for mstest.exe and your testing1099.dll?

Thanks,
Bata Chadraa
VSTT

bchadraaMSFT at 2007-9-25 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 4

Sameer Seth wrote:
Its again giving me the same error,

This is the command which i used
I tried both ways, but including space and excl. but no result.

<Exec Command = "MSTest /TestContainer:Testing1099.dll" workingdirectory="Testing1099\bin"/>

The tests execute fine, it also gives me the last statement which i get from Dos mode execution, but after that the error pops up .
Can you figure out the problem ?

Thanks
Sameer

Would you mind giving me a little tutorial or pointing me to some documentation or examples. I want to execute a list of tests from msbuild but I am not sure where to start. The above <Exec> task helps some. The "workingdirectory" is self-explanatory. I am not sure that I understand the syntax of the "Command" attribute.All of my tests are in a single project right now. The project produces a DLL. So say the path to the DLL is MyTestProject/Bin/Debug/Tests.dll. How do I specify individual tests? What happens if the test fails? Where are the results of this group of tests written to?

Thank you.

Kevin

KevinBurton at 2007-9-25 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 5

Kevin,

This is documented in detail on MSDN. Here's a pointer to the intro (http://msdn2.microsoft.com/en-us/library/ms182465(VS.80).aspx). I found a specific reference to the TestToolsTask here (http://msdn2.microsoft.com/en-us/library/aa721750(vs.80).aspx).

The results from tests run with a build are in the build report. If a test fails, then the run is considered a failure, and the build task (running tests) is also considered a failure. This will mark the build as failed.

Cheers,

David

DavidR.WilliamsonMSFT at 2007-9-25 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...

Visual Studio Team System

Site Classified