【发布时间】:2016-12-19 20:41:48
【问题描述】:
我有一段 Jenkins 管道代码,我试图在我的角度代码上运行 JUnit。
如果单元测试失败,Jenkins 必须停止流水线。 除了我看不到“最新测试结果”和“测试结果趋势”之外,它正在工作
我正在使用 Jenkins 2.19.1、Jenkins Pipeline 2.4 和 Junit 1.19。这是管道代码:
{
sh("npm install -g gulp bower")
sh("npm install")
sh("bower install")
try {
sh("gulp test")
} catch (err) {
step([$class: 'JUnitResultArchiver', testResults: '**/reports/junit/*.xml', healthScaleFactor: 1.0])
junit '**/reports/junit/*.xml'
if (currentBuild.result == 'UNSTABLE')
currentBuild.result = 'FAILURE'
throw err
}
}
知道我做错了什么吗?
【问题讨论】: