VSTS Build无法运行NUnit测试

编程入门 行业动态 更新时间:2024-10-22 14:40:16
本文介绍了VSTS Build无法运行NUnit测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

使用Visual Studio Team Services构建Visual Studio解决方案时,它会运行单元测试,并使用nunit 3 NUnit3TestAdapter用nunit 3编写,并开始运行测试.

When building a visual studio solution using visual studio team services it runs the unit tests, written in nunit 3 using the nunit 3 NUnit3TestAdapter it starts running the tests.

它给出的错误是:错误:路径中的字符非法.

完整的输出如下

2016-02-11T17:02:40.8514411Z Executing the powershell script: C:\BuildAgent\tasks\VSTest\1.0.29\VSTest.ps1 2016-02-11T17:02:41.1483135Z ##[debug]Calling Invoke-VSTest for all test assemblies 2016-02-11T17:02:41.2108131Z Working folder: C:\BuildAgent\_work\5 2016-02-11T17:02:41.2108131Z Executing C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe "C:\BuildAgent\_work\5\s\xxxxxxxxxxTests\bin\Release\xxxxxxxxxxTests.dll" /logger:trx /TestAdapterPath:"C:\BuildAgent\_work\5\s" 2016-02-11T17:02:41.5240692Z Microsoft (R) Test Execution Command Line Tool Version 14.0.24720.0 2016-02-11T17:02:41.5240692Z Copyright (c) Microsoft Corporation. All rights reserved. 2016-02-11T17:02:42.1326930Z Starting test execution, please wait... 2016-02-11T17:02:46.4921857Z Information: NUnit Adapter 3.0.8.0 executing tests is started 2016-02-11T17:02:46.5077303Z Information: Running all tests in C:\BuildAgent\_work\5\s\xxxxxxxxxxTests\bin\Release\xxxxxxxxxxTests.dll 2016-02-11T17:02:46.6327336Z Information: NUnit Adapter 3.0.8.0 executing tests is finished 2016-02-11T17:02:46.6327336Z ##[error]Error: Exception System.ArgumentException, Exception thrown executing tests 2016-02-11T17:02:46.6327336Z ##[error] 2016-02-11T17:02:46.6327336Z ##[error]Error: Illegal characters in path. 2016-02-11T17:02:46.6327336Z ##[error] 2016-02-11T17:02:46.7108474Z Information: Additionally, you can try specifying '/UseVsixExtensions' command if the test discoverer & executor is installed on the machine as vsix extensions and your installation supports vsix extensions. Example: vstest.console.exe myTests.dll /UseVsixExtensions:true 2016-02-11T17:02:46.8358887Z ##[error]VSTest Test Run failed with exit code: 1 2016-02-11T17:02:46.8514965Z ##[warning]No results found to publish.

我们有一个内部构建代理,但我认为这不会有所作为.

We have an on premise build agent but I don't think this should make an difference.

任何建议,您都可以给予赞赏.

Any advice you can give it appreciated.

推荐答案

当我使用 NUnit3测试适配器Nuget程序包.我通过安装 NUnit3测试适配器并上传了所有文件来解决了该问题将已安装的文件安装到Version Control并将其用作测试适配器.

I met this issue when I use NUnit3 Test Adapter Nuget Package during the build. And I resolved it by installing NUnit3 Test Adapter and upload all the installed files to Version Control and use it as the Test Adapter.

因为您正在使用内部构建代理.您可以轻松地在构建代理上安装NUnit3测试适配器,并使用"/UseVsixExtensions:true"自变量作为错误消息指示.

Since you are using on premise build agent. You can easily install the NUnit3 Test Adapter on the build agent and use "/UseVsixExtensions:true" argument as the error message indicates.

更多推荐

VSTS Build无法运行NUnit测试

本文发布于:2023-11-17 07:20:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1609282.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:测试   VSTS   Build   NUnit

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!