- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在我的构建管道中使用 python 对拉取请求运行一些检查。当检查失败时,我使用 sys.exit('reason')
退出脚本。这有效,但输出没有帮助。 PR 页面中显示的是:
The process 'C:\hostedtoolcache\windows\Python\3.7.9\x64\python.exe'failed with exit code 1
我想知道如何将原因传递给此页面,这样开发人员就不必深入研究管道日志来查看实际出了什么问题。在 powershell 中,我可以使用以下命令:
Write-Host "##vso[task.logissue type=error;]Reason"
Write-Host "##vso[task.complete result=Failed;]Text"
最佳答案
您可以使用相同的 logging commands在 python 中也可以使用 print()
:
steps:
- task: PythonScript@0
inputs:
scriptSource: inline
script: |
print("##vso[task.logissue type=error;]Reason")
print("##vso[task.complete result=Failed;]Text")
在 PR 中你会看到:
关于python - 如何从 python 脚本在 azure devops 管道中生成合理的错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66738557/
我有一个曾经是 TreeView 控件的菜单,但现在我想让每个项目更加直观,并向树中的每个对象添加更多信息。 我的第一个意图是制作一个代表项目的用户控件,并在运行时将它们添加到面板中。这是一个好方法吗
我是 Docker 新手,想知道是否有可能(并且是一个好主意)在 Docker 容器中进行开发。我的意思是创建一个容器,执行 bash,安装和配置我需要的一切,然后开始在容器内进行开发。 容器将成为我
在 Java 中: Parent obj = new Child(); 我创建了一个 Parent 类型的对象。我假设我只能调用父类中定义的方法。因此,我无法调用 Child 中定义的“附加”方法或访
注意:我省略了其他两个阶段(V 和 W)的代码,示例中不需要。 我很确定,我这样处理“开”和“关”时间的方式并不是一种有效的方式。 我想使用查找表实现“开”和“关”脉动。计时器应与表的当前选定值进行比
当代码中包含 Java instanceof 运算符时,许多人会扬起眉毛并说这是禁忌。例如,在这个 other SO Q&A ,答案说: Note that if you have to use th
我是一名优秀的程序员,十分优秀!