How do I publish Boost unit tests with Jenkins pipeline and xUnit plugin

Viewed 5027

I'm in the process of migrating our old Jenkins build to a declarative pipeline. We use the xUnit plugin to publish unit tests and for JUnit the following works just fine:

step([$class: 'XUnitBuilder',
      thresholds: [[$class: 'FailedThreshold', unstableThreshold: '1']],
      tools: [[$class: 'JUnitType', pattern: '**/surefire-reports/*.xml'],
              [$class: 'JUnitType', pattern: '**/generatedJUnitFiles/JUnit/*.xml'],]
     ])

My problem is that I cannot figure out how to publish our boost tests. Is there a BoostType similar to JUnitType, or are boost tests not supported yet?

3 Answers

The new xunit Plugin syntax is a bit lighter and more readable:

pipeline {
    agent any
    stages {
        stage('Test'){
            steps {
                sh "run_tests.bash"
            }
        }
    }
    post {
        always{
            xunit (
                thresholds: [ skipped(failureThreshold: '0'), failed(failureThreshold: '0') ],
                tools: [
                    JUnit(pattern: '**/surefire-reports/*.xml'),
                    JUnit(pattern: '**/generatedJUnitFiles/JUnit/*.xml'),
                    BoostTest(pattern: '**/*_results.xml')]
            )
        }
    }
 }
Related