我们当前的项目涉及构建由.Net应用程序控制的自动化盒子。我们连接了很多硬件库,并且我们建立了一个集成服务器,并连接所有硬件以运行每晚的回归测试。所有测试都通过,但TFS将构建标记为部分成功
不幸的是,并非我们设置中的所有硬件库都与TFS和MSTest很好地集成在一起。
当我们具有一定librairy运行我们的构建和测试中,我们要么这两个行为之一:
- 在 TFS通过,但构建如图 部分成功的所有测试都martked。
- TFS显示没有测试运行,但日志显示所有测试通过,构建标记为部分succeeede。在日志
来看,我们可以看到这两条线的测试后发布到TFS服务器, “处理MSTest的异常” “MSTest.exe返回0的退出代码表明,并非所有的测试通过“
真正令我困惑的是,使用mstest从命令行运行相同的测试不会显示此问题。 Futhermore,在命令行中运行时,MSTEST 返回0时通过了所有测试和1时出现错误
所以我的问题是:
- 什么是成功适当MSTest的返回码/失败
- 除了登录visual studio之外,还有其他详细的登录功能吗?
- 任何线索在哪里看?
附加信息:在mstest中使用(或不)“NoIsolation”标志时,我们确实注意到了差异。使用该标志时特定的测试会通过,但其他测试将失败......我们仍在调查那一个。
由于
编辑:日志的相关部分: 30/30测试(多个)传递
Summary
-------
Test Run Completed.
Passed 30
----------
Total 30
Results file: C:\Builds\1\Galil Daily build\TestResults\D201364-W7$_D201364-W7 2011-07-05 10_23_33_Any CPU_Debug.trx
Test Settings: Default Test Settings
Waiting to publish...
Publishing results of test run [email protected] 2011-07-05 10:23:33_Any CPU_Debug to http://mtlapp07:8080/tfs/DI_DEV...
..Publish completed successfully.
Final Property Values
Category = Galil
CommandLineArguments = /noisolation
Flavor =
MaxPriority = -1
MinPriority = -1
PathToResultsFilesRoot = C:\Builds\1\Galil Daily build\TestResults
Platform =
Publish = True
SearchPathRoot = C:\Builds\1\Galil Daily build\Binaries
TestConfigId = -1
TestConfigName =
TestContainers = System.Linq.OrderedEnumerable`2[System.String,System.String]
TestLists =
TestMetadata =
TestNames =
TestSettings =
ToolPath =
Version = -1
Final Property Values
Condition = False
Final Property Values
Condition = True
00:00
Handle MSTest Exception
MSTest.exe returned an exit code of 0 indicating that not all tests passed.
00:00
If testException is NOT TestFailureException
Initial Property Values
Condition = False
Final Property Values
Condition = False
编辑2.0:
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Galil;
namespace TestProject1
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
Galil.Galil m_galil = new Galil.Galil();
m_galil.address = "COM4 19200";
string resp = m_galil.command("MTA=2.5;");
Assert.AreEqual(":", resp);
try
{
m_galil.address = "OFFLINE";
}
catch (Exception)
{
}
}
[TestMethod]
public void TestMethod2()
{
Galil.Galil m_galil = new Galil.Galil();
m_galil.address = "COM4 19200";
string resp = m_galil.command("MTA=2.0;");
Assert.AreEqual(":", resp);
try
{
m_galil.address = "OFFLINE";
}
catch (Exception)
{
}
}
}
}
你可以发布你的日志吗? –