【问题标题】:Getting No Test Results after customising the build template for nunit tests in TFS 2010在 TFS 2010 中为 nunit 测试自定义构建模板后没有测试结果
【发布时间】:2012-02-14 19:35:47
【问题描述】:

我已经关注了将 nunit 集成到 TFS 中作为 TFS 构建的一部分的链接。 http://danderson00.blogspot.com/2011/10/running-nunit-tests-under-tfs-build.html 使用 NUNITTFS

它正在运行 nunit 测试,如果测试通过了构建,但它没有发布测试结果。

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

知道我现在缺少什么。

编辑:

    <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>

【问题讨论】:

    标签: testing build nunit-2.5.9


    【解决方案1】:

    您的设置似乎正确,换句话说:它应该可以工作。
    我的设置与您的设置非常相似,唯一与您的设置不同的是,我包含了 nunit-tests.xml 的完整路径.所以在我的构建日志中你会看到:

    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
    

    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
    

    无论如何,我都会去运行构建的服务器并尝试在CMD 中手动运行这些步骤。

    编辑(在请求提供我的 NUnitTFS 配置后)
    在这里,它似乎与您的完全不同:

    <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>
    

    我不是这里的专家,但你所拥有的 Build/v2.0/BuildService.asmx 最终闻起来像 TFS2008 配置。

    【讨论】:

    • 既然您似乎正在实现这个功能,请考虑跳到这个看起来更紧凑的替代方案:tfsbuildextensions.codeplex.com/…
    • yes 也在研究这个,但我很困惑如何做到这一点。
    • 我的实现和你的一样 - 所以很遗憾,我不能对 TFS Build Extensions 中提供的选项说太多。
    • 您能否告诉我您用于 NunitTFS.exe.config 文件的配置文件设置。我已经用我的设置更新了这个问题。希望他们是正确的
    • 在pantelif的帮助下调查后,发现我使用的是2008配置。添加 2010 的配置解决了这个问题。您可以从nunit4teambuild.codeplex.com/releases/view/45765 下载 2010。再次感谢 pantelif 对 TFS2008 配置的了解。 :)
    猜你喜欢
    • 2013-04-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多