在 TFS 2010 中自定义 nunit 测试的构建模板后未获得任何测试结果

发布于 2025-01-05 15:48:10 字数 1744 浏览 1 评论 0原文

我已按照将 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>

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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

¢蛋碎的人ぎ生 2025-01-12 15:48:10

你的设置似乎是正确的,换句话说:它应该可以工作。
我的设置与你的设置非常相似,唯一与你的设置不同的是我包含了 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 配置。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文