我有一段Jenkins管道代码,其中我正在尝试在我的angular代码上运行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
}
}
我做错了什么?
allowEmptyResults
的提示! - t0r0X'**/test-results/test/*.xml'
。 - Michel Jung