.net - 如果在容器内运行的集成测试失败,我该如何中断 Azure DevOps 管道?
问题描述
我正在尝试在 Azure DevOps 上创建一个构建管道,它将在 Docker 容器内运行一系列基于Pact .Net的集成测试。
如果这些测试中的任何一个失败,我怎么能打破这个管道?
请注意,测试是在我的容器中的 XUnit 项目中运行的。
解决方案
尝试使用dotnet test
or命令在命令行中运行测试,如果有任何错误写入 StandardError 流vstest.console.exe
,我们可以添加以中断管道。failOnStderr: false
container:
image: xxx/xxx:xxx
endpoint: 'xxx'
steps:
- script: |
xxx
failOnStderr: false
- task: CmdLine@2
inputs:
script: |
xxx
failOnStderr: true
推荐阅读
- python - 如何从 PyListObject 中“弹出”元素?
- laravel - 如何在 Laravel 5.7 的邮件函数中传递数组
- jquery - 在日期选择器中选择开始日期时仅显示一个月日期
- go - 无法使用 Golang 从带有 mySQL 后端的 gorilla/sessions 中获取价值
- jquery - 如何在圆周半圆中设置渐变
- python - Scipy:来自数组的稀疏指示矩阵
- angular - 无法在 Mat-Datepicker 中进行两种方式绑定
- javascript - 如何将日期和时间组合成一个日期时间对象?
- java - 如何使“xsd:double”显示没有指数?
- c# - 如果用户尚未登录,则将 MVC URL 重定向到登录页面