mstest

How to stop MsTest tests execution after *n* failed tests

橙三吉。 提交于 2019-12-01 11:16:37
I want to run unit tests via MS Test (from windows console) in a way that I can stop/kill the test execution whenever the failed tests count exceeds certain threshold value. For my use case there is no point to keep running tests when certain percentage of the tests already failed. I can only think in creating a new console app to wrap the mstest.exe execution, so I can parse the standard output in real-time, and eventually kill the process, for example: var pi = new ProcessStartInfo() { FileName = MS_TEST, UseShellExecute = false, RedirectStandardOutput = true, Arguments = MS_TEST_ARGS }; int

NUnit doesn't find tests in assembly

时间秒杀一切 提交于 2019-12-01 08:52:36
I inherited an assembly with MSTest, but these tests were run using nunit-console on the build machine (not sure how it worked). So I decided to sort it out and change them to proper NUnit tests, but now nunit-console (or gui) can't find any tests. They run just fine using ReSharper test runner though. Any idea what could be missing? Check: Is the class public? Does it have a public parameterless constructor (e.g. the default one if you don't specify any other constructors) Does it have the [TestFixture] attribute at the class level? Is each test public? Does each test have the [Test]

Unit Test Adapter threw exception: URI formats are not supported

≡放荡痞女 提交于 2019-12-01 08:21:43
In Visual Studio 2010 when I create the default test project with the following bare bones code: <TestClass()> Public Class UnitTest1 <TestMethod()> Public Sub TestMethod1() Assert.AreEqual(1, 1) End Sub End Class I get the following error: Unit Test Adapter threw exception: URI formats are not supported.. -- Exception doesn't have a stack trace -- Open up Local.testsettings in your Solution Explorer > Solution Items Go to Deployment and make sure Enabled Deployment is checked (it's unchecked by default) 来源: https://stackoverflow.com/questions/27509543/unit-test-adapter-threw-exception-uri

Running VS2012 unit tests from TFS2010 Team Build

a 夏天 提交于 2019-12-01 08:05:17
I have a Visual Studio 2012 solution using .NET 4.5 framework. The rest of our development system is TFS2010. Recently some of our unit tests have been failing on the build server only. After going through several rounds of debugging I was able to determine that the cause of the failed tests was most likely due to the version of MSTest being used on the build server. The tests in question pass when run from VS2012 on my local machine and when run from VS2012 on the actual build server. I have followed the steps described in the following articles (I have not found any useful articles directly

How to stop MsTest tests execution after *n* failed tests

百般思念 提交于 2019-12-01 07:45:41
问题 I want to run unit tests via MS Test (from windows console) in a way that I can stop/kill the test execution whenever the failed tests count exceeds certain threshold value. For my use case there is no point to keep running tests when certain percentage of the tests already failed. I can only think in creating a new console app to wrap the mstest.exe execution, so I can parse the standard output in real-time, and eventually kill the process, for example: var pi = new ProcessStartInfo() {

Which version of VS should I install to allow unit testing on the build server?

无人久伴 提交于 2019-12-01 07:36:40
Since a few weeks we have our first TFS (2013) setup. The setup is rather small and there are only a handful (read: 10) developers that will have to work with it for the time being. It was setup as a "test" to see if it fits within our organisation. Now, we'd also like to test the build server functionality. We've configured the build server and enabled a single agent. The MSDN then states that "You must install on the build agent the version of Visual Studio that your team uses on its dev machines." ( http://msdn.microsoft.com/en-us/library/bb399135.aspx ). This sounds pretty straight forward

Unit Test Adapter threw exception: URI formats are not supported

半腔热情 提交于 2019-12-01 07:21:54
问题 In Visual Studio 2010 when I create the default test project with the following bare bones code: <TestClass()> Public Class UnitTest1 <TestMethod()> Public Sub TestMethod1() Assert.AreEqual(1, 1) End Sub End Class I get the following error: Unit Test Adapter threw exception: URI formats are not supported.. -- Exception doesn't have a stack trace -- 回答1: Open up Local.testsettings in your Solution Explorer > Solution Items Go to Deployment and make sure Enabled Deployment is checked (it's

Using MSTest, xUnit or NUnit with dotnet core

被刻印的时光 ゝ 提交于 2019-12-01 05:58:27
TLDR - Jump to the answer for details on a working xUnit or MSTest setup. xUnit was the least painful option. I've been unable to get NUnit working on my build server so I've resorted to trying both xUnit and MSTest - Neither have worked for me. MSTest I just dont get - I expected this to work but when I try to install dotnet-test-mstest from nuget I get dependency issues as all of it's dependent libraries are not compatible for netcoreapp1 for example.... The dependency MSTest.ObjectModel 1.0.1-preview does not support framework .NETCoreApp,Version=v1.0. The dependency MSTest.TestAdapter

Running VS2012 unit tests from TFS2010 Team Build

做~自己de王妃 提交于 2019-12-01 05:53:21
问题 I have a Visual Studio 2012 solution using .NET 4.5 framework. The rest of our development system is TFS2010. Recently some of our unit tests have been failing on the build server only. After going through several rounds of debugging I was able to determine that the cause of the failed tests was most likely due to the version of MSTest being used on the build server. The tests in question pass when run from VS2012 on my local machine and when run from VS2012 on the actual build server. I have

Failed to queue test run: Unable to start the agent process(Visual Studio 2010)

你离开我真会死。 提交于 2019-12-01 05:48:41
While trying to run all the unit tests in my solution(Visual Studio 2010) I am getting a 'Failed to queue test run xxxx@MACHINENAME 2010-06-23 14:01:36': Unable to start the agent process' error. Does anyone know what causes this particular error to occur and how to resolve it so that I can run my unit tests? Thanks I don't know if this is still the case for Visual Studio 2010, but you could have this same scenario in Visual Studio 2008. When breaking off a unit test run (i.e. when detecting erroneous code while debugging a unit test) it would leave a process running. The process that is