chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes
Hi,

When the build gets done and there are some failed unit tests are showing, I could set the build partially succeeded for VS 2010 based projects in TFS 2010 as setting the workflow condition,

if ExternalTestRunnerResult <> 0 And ExternalTestRunnerResult <> 128
then AB assign
BuildDetail.TestStatus = Microsoft.TeamFoundation.Build.Client.BuildPhaseStatus.Failed

However, I'm using the same build condition for VS2012 solution in TFS 2010 that the value of ExernalTestRunnerResult shows in unknown so that the buildDetail.TestStatus can't be set to partially succeeded any more.

Is there any work around or a different way to set the build partially succeeded whenever there is failed unit test?

The current TypeMock Isolator installed on the build server is 7.0.9.0
asked by (12.5k points)

4 Answers

0 votes
I have updates to share for the earlier post.

We have two build servers; one server installed with 7.0.9 for a branch and another one installed with 7.1.6 I downloaded from https://www.typemock.com/answers/11386/.

The branch with 7.0.9 installed build server is running ExternalTestRunnerResult working fine that the build goes to "partially succeeded" whenever there is a failed unit test(s) but there is no code coverage running. This build shows 99% average pass rate.

The branch with 7.1.6 installed build sever, where the solution is created in either VS 2010 or VS2012, isn't running ExternalTestRunnerResult at all. It still shows the ExternalTestRunnerResult as "Unknown" and there is no coverage. Also, it fails lots of unit test passing only 12 ~ 14% only.

Both branches are the same code based since one branch got branched from the other.
answered by (12.5k points)
0 votes
I had to uninstall 7.1.6 patch version since it does run too long. Average of the build including unit test takes about 20 min but the patch one ran up to over 60 min for a single build.

Currently started to test with the release version of 7.1.6 I downloaded from the download page, all the unit test runs fine but ExternalTestRunnerTestResult still passes "Unknown" value so that build status is "Build succeeded" still even though there is a failed unit test result.
answered by (12.5k points)
0 votes
I wrote the externaltestrunner prior to Typemock releasing their official tfs2010.dll set of build activities to get around the problem that a TFS 2010 build can be multi threaded. I would strongly suggest using the official activities now they are available for 2010, you will find the DLL in the typemock folder (or the version I ported/created for TFS 2012 from the typemock website).

These activities have the major advantage that they allow automated deploy of Typemock at build time, so management of build agents are much easier. Also they remove the test result translation code used in the externaltestrunner, as they use the standard Mictrosoft test runner it handles all the publishing of results. If you are using TFS 2012 this can also handle unit test in nunit or xunit as well as MStest
answered by (6.8k points)
0 votes
That's good to know and thanks for your post which I just saw today.
Let me try to install and see how it works for me. Are you using the version 7.0.6?

You're correct that now the build sets to partially succeeded in 7.0.6 whenever there is one or more unit test failed. I just need one more needs to be available which is TestResults.Trx.

Please mark this post as fixed.

Thank you,
answered by (12.5k points)
...