pana_to_junit 1.0.0

Dart native
Flutter Android iOS

Convert the output of pana to a JUnit XML file, for example to include pana in CI like Jenkins.

Pana to JUnit #

A dart application to convert pana JSON output to JUnit XML format, for example to be displayed in Jenkins CI.

Example #

# Run Pana on a package, e.g. redis
pub global run pana redis > out.json

# Use Pana to JUnit to convert pana output to JUnit Report
pub global run pana_to_junit --input out.json --output report.xml

Include in Jenkins Workflow #

This repository includes itself in its CI Workflow:

In the Jenkinsfile, have one step where pana is running. Afterwards, convert the output and collect it in a post step.

pipeline {
    stages {
        stage('Test') {
            steps {
                echo 'Check Health'
                sh 'pub run pana --no-warning --source path ${WORKSPACE} > out.json'
                sh 'pub global run pana_to_junit:main --input out.json --output pana-report.xml'
            }
        }

    }

    post {
        always {
            junit 'pana-report.xml'
        }
    }
}

Depending on the severness of the suggestions, these are displayed by Jenkins BlueOcean as Accepted or failed tests. All tests have passed, as no suggestion is higher rated than bug Not all tests have passed, as one suggestion is a warning

0
likes
60
pub points
0%
popularity

Convert the output of pana to a JUnit XML file, for example to include pana in CI like Jenkins.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

eknoes94@gmail.com

License

AGPL 3.0 (LICENSE)

Dependencies

args, junitreport, pana, path, testreport

More

Packages that depend on pana_to_junit