4

I have followed the link for integrating nunit in TFS as part of TFS build. http://danderson00.blogspot.com/2011/10/running-nunit-tests-under-tfs-build.html using NUNITTFS

It is running the nunit tests and if tests passed passing the build but it is not publishing the test results.

4 projects/solutions compiled
No Test Results
No Code Coverage Results
Impacted Tests
No tests were impacted

Invoke NUnit
C:\Program Files (x86)\NUnit 2.5.9\bin\net-2.0\nunit-console.exe /xml:nunit-tests.xml /framework:net-4.0 Z:\TFSBuilds\1\Sandbox\Tests\Binaries\Tests.dll

00:00
Publish NUnit Results
C:\Program Files (x86)\NUnitTfs\NUnitTfs.exe -n nunit-tests.xml -t Sandbox -p "Any CPU" -f Release -b "Tests_20120213.6" -v 2010

00:00
If NUnit Tests Failed

Any Idea what I am missing now.

Edited:

    <client>
        <endpoint address="http://mgr:8080/tfs/basecollection/Build/v2.0/BuildService.asmx"
            binding="basicHttpBinding" bindingConfiguration="BuildServiceSoap"
            contract="BuildServiceV2.BuildServiceSoap" name="BuildServiceSoap" />

        <endpoint address="http://mgr:8080/tfs/basecollection/Build/v1.0/PublishTestResultsBuildService2.asmx"
            binding="basicHttpBinding" bindingConfiguration="LinkingService"
            contract="PublishTestResultsBuildService2V1.LinkingService"
            name="LinkingService" />

        <endpoint address="http://mgr:8080/tfs/basecollection/Build/v1.0/PublishTestResultsBuildService2.asmx"
            binding="basicHttpBinding" bindingConfiguration="Service2Soap"
            contract="PublishTestResultsBuildService2V1.Service2Soap"
            name="Service2Soap" />
    </client>
sam
  • 4,594
  • 12
  • 61
  • 111

1 Answers1

1

Your setup seems correct, in other words: it should work.
I have a very similar setup to yours, the only thing that varies against to the one you have is that I include the full path to nunit-tests.xml. So in my build-log you would see:

Invoke NUnit
C:\Program Files (x86)\NUnit 2.5.9\bin\net-2.0\nunit-console.exe /xml:C:\somepath\nunit-tests.xml  Z:\TFSBuilds\1\Sandbox\Tests\Binaries\Tests.dll

and

Publish NUnit Results
C:\Program Files (x86)\NUnitTfs\NUnitTfs.exe -n C:\somepath\nunit-tests.xml -t Sandbox -p "Any CPU" -f Release -b "Tests_20120213.6" -v 2010

In any case, I would go to the Server that runs the builds and try running the steps by hand in a CMD.

EDIT (after request to deliver my NUnitTFS-config)
Here it is, it seems quite different to yours:

<client>
    <!-- TFS 2010 services. -->
    <endpoint address="http://TFS/tfs/Collection/TestManagement/v1.0/TestResults.asmx"
     binding="basicHttpBinding" bindingConfiguration="TestResultsServiceSoap"
     contract="Tfs2010.TestResultsServiceV1.TestResultsServiceSoap" name="TestResultsServiceSoap" />

    <endpoint address="http://TFS/tfs/Collection/Services/v3.0/IdentityManagementService.asmx"
     binding="basicHttpBinding" bindingConfiguration="IdentityManagementWebServiceSoap"
     contract="Tfs2010.IdentityManagementServiceV3.IdentityManagementWebServiceSoap"
     name="IdentityManagementWebServiceSoap" />

    <endpoint address="http://TFS/tfs/Collection/Build/V3.0/BuildService.asmx"
     binding="basicHttpBinding" bindingConfiguration="BuildWebServiceSoap"
     contract="Tfs2010.BuildServiceV3.BuildWebServiceSoap" name="BuildWebServiceSoap" />
</client>

I am hardly the expert here, but what you have as Build/v2.0/BuildService.asmx, eventually smells like a TFS2008 configuration.

pantelif
  • 8,524
  • 2
  • 33
  • 48
  • Since you seem to be implementing this functionality, consider jumping to this alternative that seems a lot more compact: http://tfsbuildextensions.codeplex.com/wikipage?title=How%20to%20integrate%20the%20nUnit%20build%20activity&referringTitle=Documentation – pantelif Feb 13 '12 at 12:40
  • yes Also looking into this but I am preety confused as how to do this. – sam Feb 13 '12 at 12:58
  • My implementation is just like yours - so unfortunately I can't say much about the option provided in the TFS Build Extensions. – pantelif Feb 13 '12 at 16:24
  • Can you plz tell me the configuration file settings you are using for NunitTFS.exe.config file. I have updated the question with my settings. Hope they are correct – sam Feb 14 '12 at 11:19
  • After investigating with the help of pantelif, Figured out to be that I was using 2008 configuration. Adding the configuration for 2010 fixed the problem. You can download the 2010 from http://nunit4teambuild.codeplex.com/releases/view/45765. Again thanks to pantelif for smelling out the TFS2008 configuration. :) – sam Feb 14 '12 at 13:09