jenkins - Jenkins & Newman:HTMLEXTRA 报告使用 Jenkins html 发布者在项目级别发布,仅用于成功的 Jenkins 构建
问题描述
我已经设置了一个Jenkins
多分支管道Postman
,使用Newman
. 我用过的记者是-r cli,htmlextra,junit,junitfull
。
该HTMLEXTRA
报告确实使用Jenkins htmlpublisher
项目级别发布,但是,仅适用于成功的 Jenkins 构建。换句话说,只有当所有 API 测试都通过时,才能HTMLEXTRA
直接从项目菜单访问报告,如下面的屏幕截图所示。
对于失败的构建,HTMLEXTRA
虽然会创建报告,但我可以在菜单中为每个 Jenkins 运行打开它们,但不能在整个项目级别上打开它们。只有最新的成功构建报告被链接。
我的POSTACTIONS
Jenkins 阶段如下所示:
post {
always {
archiveArtifacts artifacts: 'build/report.html', fingerprint: true
publishHTML (target: [ //DOCUMENTATION can be found here: https://plugins.jenkins.io/htmlpublisher/
allowMissing: false, //If checked, will allow report to be missing and build will not fail on missing report.
alwaysLinkToLastBuild: true, //If this control and "Keep past HTML reports" are checked, publish the link on project level even if build failed.
keepAll: true, //If checked, archive reports for all successful builds, otherwise only the most recent.
reportDir: 'build', //The path to the HTML report directory relative to the workspace.
reportFiles: 'report.html', //The file(s) to provide links inside the report directory.
reportName: 'Newman Test Report'
])
junit "build/report-full.xml"
}
}
我的理解是 ifalwaysLinkToLastBuild
和keepAll
are both ,即使构建失败true
,最新报告的链接也会在项目级别发布。HTMLEXTRA
请参阅此处的官方文档https://plugins.jenkins.io/htmlpublisher。
即使对于失败的 Jenkins 构建,您能帮我发布HTMLEXTRA
项目级别的报告吗?非常感谢!
解决方案
推荐阅读
- javascript - 如何在 Angular 中处理 $numberDecimal 属性?
- python - 列表理解与列表中元素的总和
- python - 使用Python在“xlsx”Excel中读取单元格内容时保留下标和上标
- openedge - 如何根据变量初始值更改日期格式?
- google-apps-script - TypeError: this[e.parameter.run] 不是函数
- awk - 带有可变数量参数的 AWK 函数
- reactjs - React Redux 在减速器中分配箭头功能警告
- apache-spark - Databricks 集群是否需要始终保持 Delta Lake 的 VACUUM 操作?
- youtube-api - YouTube Data API 搜索结果包括指定频道以外的视频
- unity3d - 如何获取对游戏对象位置的引用