首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >程序“coverlet.exe”无法运行:文件名或扩展名太longAt D:\a\1\s\pipeline.ps1:15 char:1

程序“coverlet.exe”无法运行:文件名或扩展名太longAt D:\a\1\s\pipeline.ps1:15 char:1
EN

Stack Overflow用户
提问于 2019-11-19 02:05:20
回答 1查看 743关注 0票数 0

我试图在azure devOps build管道中运行一个shell脚本,以便将测试结果代码覆盖率发布到azure管道中的coverage选项卡中,并得到这个错误。这是我的剧本

代码语言:javascript
复制
"install tools:"
&dotnet tool install dotnet-reportgenerator-globaltool --tool-path . --version 4.0.12
&dotnet tool install coverlet.console --tool-path . --version 1.4.1

"`nmake reports dir:"
mkdir .\reports

"`nrun tests:"
$unitTestFile = gci -Recurse | ?{ $_.FullName -like "**\*Test*.dll" }
Write-Host "`$unitTestFile value: $unitTestFile"

$coverlet = "$pwd\coverlet.exe"

"calling $coverlet for $($unitTestFile.FullName)"
&$coverlet $unitTestFile.FullName --target "dotnet" --targetargs "vstest $($unitTestFile.FullName) --logger:trx" --format "cobertura"

"`ngenerate report(s)"
gci -Recurse | 
    ?{ $_.Name -eq "coverage.cobertura.xml" } | 
    %{ &"$pwd\reportgenerator.exe" "-reports:$($_.FullName)" "-targetdir:reports" "-reporttypes:HTMLInline;HTMLChart" }

更新-错误日志

代码语言:javascript
复制
D:\a\1\s\packages\NUnit3TestAdapter.3.15.1\build\netcoreapp2.0\NUnit3.TestAdapter.dll
Program 'coverlet.exe' failed to run: The filename or extension is too longAt D:\a\1\s\pipeline.ps1:15 char:1
+ &$coverlet $unitTestFile.Name --target "dotnet" --targetargs "vstest  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
At D:\a\1\s\pipeline.ps1:15 char:72
+ ... e --target "dotnet" --targetargs "vstest $($unitTestFile.Name) --logg ...
+                                                ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : NativeCommandFaile

D

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-11-29 07:13:36

我发现这个参数$unitTestFile = gci -Recurse | ?{ $_.FullName -like "**\*Test*.dll" }需要多个dll文件,并且不得不将其简化为单个dll。解决了这个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58925597

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档