小编hid*_*isk的帖子

无法在Jenkins管道中显示JUnit测试结果

我有一段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
        }
    }
Run Code Online (Sandbox Code Playgroud)

jenkins jenkins-pipeline

6
推荐指数
3
解决办法
3万
查看次数

标签 统计

jenkins ×1

jenkins-pipeline ×1