How to publish Boost module tests with the Jenkins pipeline and xUnit plugin

I am in the process of moving our old Jenkins build to the declarative pipeline. We use the xUnit plugin to publish unit tests, and for JUnit the following works are 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 anything BoostTypesimilar to JUnitTypeor are enhancement tests not supported?

+4
source share
3 answers

The answer turned out to be BoostTestJunitHudsonTestType. This is the code:

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

There is a class BoostTestin Jenkins xUnit plugin .

+2

xunit :

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')]
            )
        }
    }
 }
0

Source: https://habr.com/ru/post/1681574/


All Articles