Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 636
user3029642 Avatar asked Jul 16 '17 21:07

user3029642


People also ask

What are the plugin used as extension for xUnit plugin?

Other plugins as an extension of the xUnit plugin:Gallio (Gallio plugin) Parasoft C++Test tool (Cpptest Plugin) JSUnit (JSUnit Plugin) JBehave.


1 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')]
            )
        }
    }
 }
like image 124
OlivierM Avatar answered Oct 04 '22 09:10

OlivierM