管道:.NETCORECLI测试任务引发非零错误
我已经为.NET 5 API项目和Xunit测试项目使用了以下YML命令,但是它会引发错误,并且我的管道没有成功。我哪里出错了?
注意:即使执行了测试用例并显示了15例测试用例,并提交了2例测试用例,即使执行了测试案例,管道也不会成功。
- task: DotNetCoreCLI@2
inputs:
command: 'restore'
projects: '**/GeniusData.Test/GeniusData.Test.csproj'
displayName: 'Restore Projects'
- task: DotNetCoreCLI@2
inputs:
command: test
projects: '**/*Test/*.csproj'
arguments: '--configuration $(buildConfiguration) --collect "Code coverage"'
displayName: 'Test Project'
I have used the following yml command for my .Net 5 API project and xUnit Test Project but it throws error and my pipeline is not getting succeeded. Where did I go wrong?
Note: The pipeline is not getting succeded even if the task executed the test cases and showing 15 test cases passed and 2 test cases are filed.
- task: DotNetCoreCLI@2
inputs:
command: 'restore'
projects: '**/GeniusData.Test/GeniusData.Test.csproj'
displayName: 'Restore Projects'
- task: DotNetCoreCLI@2
inputs:
command: test
projects: '**/*Test/*.csproj'
arguments: '--configuration $(buildConfiguration) --collect "Code coverage"'
displayName: 'Test Project'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在使用
dotnetCorecli@2
任务,该任务在测试失败时总是会失败。那是设计:失败的测试应破坏构建。You're using the
DotNetCoreCLI@2
task which will always fail when tests fail. That's by design: failing tests should break the build.