Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Parasoft Findings Plugin integrates with the Warnings Next Generation plug-in to report Parasoft code analysis results. Refer to the following table to determine which version of Jenkins and the Warnings Next Generation plug-in is supported by the Parasoft Findings Plugin. If your version is not shown in the table, it supports the same Jenkins and Warnings NG versions as the next, lowest version.

Parasoft Findings VersionJenkins VersionWarnings NG Version
10.7.22.
387
426.3+
10
11.
5
0.
1
0+
10.6.32.387.3+10.5.1+
10.6.22.387.1+10.0.3+
10.5.32.289.1+9.10.3+
10.4.42.138.4+8.x
10.4.32.138.4+6.x
10.4.22.89.1+4.x
10.4.11.625.1+N/A

Previous versions are available from the Jenkins plug-in releases section.

...

Add a step to the pipeline script that calls the Warnings Next Generation publisher. You can add Parasoft Findings with the tool parameter and specify the location of the report.xml file(s) and the settings.properties file as arguments. For example:

noformat
Code Block
titleScripted pipeline
node {
  recordIssues(  stage('Publishing Static Analysis Results') {
    tools: parasoftFindings    recordIssues (
      pattern: '**/*      tools: [
                parasoftFindings (
                    pattern: '**/report.xml',
                    localSettingsPath: 'settings.properties'
    )
  )
}

Pass the following arguments to the parasoftFindings parameter:

pattern 

Specify the location of the static analysis results report (report.xml) file in the Report File Pattern field. You can use an Ant-style pattern to specify multiple directories.

localSettingsPath 

Specify the location of the settings.properties file for your Parasoft tool. The .properties file contains settings that, for example, connect the tool to DTP, specify build ID, etc. Refer to your tool documentation to learn more about the settings files.

Publishing Static Analysis Results for 10.4.1

Use Parasoft Findings for Jenkins 10.4.1 if you are on an older version of Jenkins. Download the .hpi file from the plug-in archive directory (see Requirements) and install it as described in the Web UI section. See Viewing 10.4.1 Findings for information about understanding the output from Parasoft Findings 10.4.1. 

Maven and Freestyle Jobs

            )
            ]
        )
    }
}
Code Block
titleDeclarative pipeline
pipeline {
    agent any
    stages {
        stage('Publishing Static Analysis Results') {
            steps {
                recordIssues (
                    tools: [
                        parasoftFindings (
                            pattern: '**/report.xml',
                            localSettingsPath: 'settings.properties'
                        )
                    ]
                )
            }
        }
    }
}

The parameters passed to parasoftFindings:

  • pattern: Specifies the location of the static analysis results report (for example, report.xml). You can use an Ant-style pattern to specify multiple directories.
  • localSettingsPath: Specifies the location of the settings.properties file for your Parasoft tool. The .properties file contains settings that, for example, connect the tool to DTP, specify build ID, and so on. Refer to your tool documentation to learn more about the settings files.

Publishing Static Analysis Results for 10.4.1

Use Parasoft Findings for Jenkins 10.4.1 if you are on an older version of Jenkins. Download the .hpi file from the plug-in archive directory (see Requirements) and install it as described in the Web UI section. See Viewing 10.4.1 Findings for information about understanding the output from Parasoft Findings 10.4.1. 

Maven and Freestyle Jobs

  1. Enable the Publish Parasoft analysis results option. 
    • For Maven jobs, choose Configure> Build Settings and enable the Publish Parasoft analysis results option. 
      Image Added
    • For Freestyle jobs: 
      1. Choose Configure> Post-build Actions> Add post-build action
      2. Choose Publish Parasoft analysis results from the drop-down menu.
        Image Added
  2. Specify an absolute or workspace-relative path to the settings file used by your Parasoft Analyzer in the Settings field. The settings file should include the report.location property, which specifies where the report.xml file is saved. See the documentation for your analyzer for additional information about configuring the settings file.
  3. You can also enable the Report location option and specify a workspace-relative path to the report.xml file generated by Parasoft Analyzer in the File pattern field. This setting overrides the report.location configuration from the previous
  4. Enable the Publish Parasoft analysis results option. 
    • For Maven jobs, choose Configure> Build Settings and enable the Publish Parasoft analysis results option. 
      Image Removed
    • For Freestyle jobs: 
      1. Choose Configure> Post-build Actions> Add post-build action
      2. Choose Publish Parasoft analysis results from the drop-down menu.
        Image Removed
  5. Specify an absolute or workspace-relative path to the settings file used by your Parasoft Analyzer in the Settings field. The settings file should include the report.location property, which specifies where the report.xml file is saved. See the documentation for your analyzer for additional information about configuring the settings file.
  6. You can also enable the Report location option and specify a workspace-relative path to the report.xml file generated by Parasoft Analyzer in the File pattern field. This setting overrides the report.location configuration from the previous step and is useful when Jenkins and the directory for the report.xml file are both on the local machine.

...

Code Block
languagejava
step(\[$class: 'ParasoftPublisher', useReportPattern: true, reportPattern: '*.xml', settings: ''\])

or

Code Block
languagejava
parasoftFindings useReportPattern: true, reportPattern: '*.xml', settings: ''

The parameters passed correspond to the options following available in plugin configuration:

useReportPattern

Report location option

reportPattern

File pattern field

settings

Settings field

C/C++test Professional Report Settings

Reports for If you are generating static analysis generated reports with C/C++test Professional 2023.2 or later can be used directly to support navigation to 1 or earlier, make sure the Add absolute file paths to XML data option is enabled to link the source code if it is stored in the Jenkins workspace.
If you are generating static analysis reports with C/C++test Professional 2023.1 or earlier, make sure the Add absolute file paths to XML data option is enabled. You can enable this option on the command line by setting the report.location_details=true property in the settings file.

...

Connect your tool to DTP by configuring the following settings dtp.url setting in your tool's .properties file

  • dtp.url (since 10.6.1)
  • dtp.server 
  • dtp.port 
  • dtp.user (see note below)
  • dtp.password (see note below)

It is recommended that you use DTP 2022.2 or later.

. For example, dtp.url=https://<HOST>:<PORT>.

Note: Only Note: With DTP 2023.1 or later , it is not necessary to provide DTP with a username and password to get rule documentationis supported.

Local Documentation

For local documentation, set the report.rules property to the directory that contains the analyzer documentation. For example: report.rules=<TOOL_INSTALL>/rules/doc

...

To publish unit and functional test results using a pipeline job, add a step to call the xUnit publisher class and specify the appropriate type of reports to publish:

ParasoftAnalyzers-10.x

Code Block
languagetitlejavaScripted pipeline
node {
    stage('Publishing Test Execution Results') {
        xunit (
           step(\[$class: 'XUnitPublisher', tools: \[\[$class: 'ParasoftType', pattern: '**/report.xml'\]\]\])

...

]
        )
    }
}
Code Block
languagetitlejava
step(\[$class: 'XUnitPublisher', tools: \[\[$class: 'ParasoftSOAtest9xType', pattern: ''\]\]\])

C/C++test Unit Test Results

C/C++test reports for unit test results must be generated with the Overview of checked files and executed tests option enabled. You can enable this option on the command line by setting the report.contexts_details=true property in the settings file.

Viewing Test Execution Results

The test execution trend graphs shows test status, execution time, and stack trace for test failures.
Image Removed
Image Removed
Image Removed
Image Removed

Publishing Code Coverage Results

You can publish code coverage from Maven, Freestyle, and Pipeline job executions.

Freestyle and Maven Jobs

  1. Go to Configure > Post-build Actions > Add post-build action and choose Record Parasoft code coverage results.
    Image Removed
  2. Enter the relative path to the Parasoft coverage files that you want to use in the Report File Pattern field. To enter multiple paths, separate them by commas.
  3. Enter the name of the job that you want to use in the Reference Job field. For more information about specifying a reference job, see https://www.jenkins.io/doc/book/using/referencing-another-project-by-name/.  If this field is left empty, the current job will be used as a default.
  4. Enter a build number from reference job in the Reference Build field. The build number can be found in the build title after the '#' symbol. If this field is left empty, last stable build will be used as a default.
  5. (Optional) Add quality gates to evaluate after a build. See Configuring Quality Gates.
  6. Choose the correct encoding for the source files from the Source Code Encoding menu. If this field is left empty, the platform's default encoding will be used.
    Image Removed
  7. Click Save.

Pipeline Jobs

To publish code coverage using a pipeline job, add a pipeline script that calls the Parasoft Findings plugin. For example:

Code Block
pipeline {
  agent any
  stages {
    stage('Parasoft coverage') {
      steps {
        recordParasoftCoverage pattern: '**/coverage.xml', referenceBuild: '20', referenceJob: 'Demo', sourceCodeEncoding: 'UTF-8'
    }
    }
  }
}

If no sourceCodeEncoding value is specified, UTF-8 will be used as a default.

Alternatively, you can generate a script of Parasoft Findings Plugin by Pipeline Syntax:

Declarative pipeline
pipeline {
    agent any
    stages {
        stage('Publishing Test Execution Results') {
            steps {
                xunit (
                    tools: [[$class: 'ParasoftType', pattern: '**/report.xml']]    
                )
            }
        }
    }
}

ParasoftSOAtest-9.x

Code Block
titleScripted pipeline
node {
    stage('Publishing SOATest Results') {
        xunit (
            tools: [[$class: 'ParasoftSOAtest9xType', pattern: '**/report.xml']]
        )
    }
}
Code Block
titleDeclarative pipeline
pipeline {
    agent any
    stages {
        stage('Publishing SOATest Results') {
            steps {
                xunit (
                    tools: [[$class: 'ParasoftSOAtest9xType', pattern: '**/report.xml']]
                )
            }
        }
    }
}

C/C++test Professional Unit Test Results

C/C++test reports for unit test results must be generated with the Overview of checked files and executed tests option enabled. You can enable this option on the command line by using the option -property report.contexts_details=true or by setting the report.contexts_details=true property in the settings file.

Starting with version 2024.1, you can also use the command line option -property report.additional.report.dir=<REPORT_DIR> when generating the reports and use reports generated in this directory.

Viewing Test Execution Results

The test execution trend graphs shows test status, execution time, and stack trace for test failures.
Image Added
Image Added
Image Added
Image Added

Publishing Code Coverage Results

You can publish code coverage from Maven, Freestyle, and Pipeline job executions.

Freestyle and Maven Jobs

  1. Go to Configure > Post-build Actions > Add post-build action and choose Record Parasoft code coverage results.
    Image Added
  2. Enter the relative path to the Parasoft coverage files that you want to use in the Report File Pattern field. To enter multiple paths, separate them by commas.
  3. Enter the name of the job that you want to use in the Reference Job field. For more information about specifying a reference job, see https://www.jenkins.io/doc/book/using/referencing-another-project-by-name/.  If this field is left empty, the current job will be used as a default.
  4. Enter a build number from reference job in the Reference Build field. The build number can be found in the build title after the '#' symbol. If this field is left empty, last
  5. Choose recordParasoftCoverage from theSample Stepmenu.
  6. Enter the relative path to the Parasoft coverage file in the Report File Pattern field. To enter multiple paths, separate them by commas.
  7. Enter the name of the job that you want to use in the Reference Job field. For more information about specifying a reference job, see https://www.jenkins.io/doc/book/using/referencing-another-project-by-name/. If this field is left empty, the current job will be used as a default.
  8. Enter a build number from reference job in the Reference Build field. The build number can be found in the build title after the '#' symbol. If this field is left empty, last stable build will be used as a default.
  9. (Optional) Add quality gates to evaluate after a build. See Configuring Quality Gates.
  10. Choose the correct encoding for the source files from the Source Code Encoding menu. If this field is left empty, the platform's default encoding will be used.
    Image RemovedImage Added
  11. Click  Generate Pipeline Script Save.

Viewing Code Coverage Results

You can view the total coverage of each build in the Status tab.

Image Removed

Click the Parasoft Coverage tab to view the details of your code coverage. This tab has three sub-tabs for Overview, Overall Code Coverage, and Modified Code Coverage views.

Image Removed

Image Removed

Image Removed

...

Pipeline Jobs

To publish code coverage using a pipeline job, add a step to call the Parasoft Findings plugin. For example:

Code Block
titleScripted pipeline
node {
    stage('Publishing Code Coverage Results') {
        recordParasoftCoverage (
            pattern: '**/coverage.xml',
            referenceBuild: '20',
            referenceJob: 'Demo', 
            sourceCodeEncoding: 'UTF-8'
        )
    }
}
Code Block
titleDeclarative pipeline
pipeline {
    agent any
    stages {
        stage('Publishing Code Coverage Results') {
            steps {
                recordParasoftCoverage (
                    pattern: '**/coverage.xml',
                    referenceBuild: '20',
                    referenceJob: 'Demo', 
                    sourceCodeEncoding: 'UTF-8'
                )
            }
        }
    }
}

The parameters passed to recordParasoftCoverage:

  • pattern: Specifies the location of the coverage report (for example, coverage.xml).
  • referenceBuild: Specifies a reference build. If not specified, the last stable build will be used by default.
  • referenceJob: Specifies a reference job. If not specified, the current job will be used by default.
  • sourceCodeEncoding: Specifies the character encoding of your source code. If not specified, the platform's default encoding will be used.

Alternatively, you can generate a script of Parasoft Findings Plugin by Pipeline Syntax:

  1. Choose recordParasoftCoverage from theSample Stepmenu.
  2. Enter the relative path to the Parasoft coverage file in the Report File Pattern field. To enter multiple paths, separate them by commas.
  3. Enter the name of the job that you want to use in the Reference Job field. For more information about specifying a reference job, see https://www.jenkins.io/doc/book/using/referencing-another-project-by-name/. If this field is left empty, the current job will be used as a default.
  4. Enter a build number from reference job in the Reference Build field. The build number can be found in the build title after the '#' symbol. If this field is left empty, last stable build will be used as a default.
  5. (Optional) Add quality gates to evaluate after a build. See Configuring Quality Gates.
  6. Choose the correct encoding for the source files from the Source Code Encoding menu. If this field is left empty, the platform's default encoding will be used.
    Image Added
  7. Click Generate Pipeline Script.

Viewing Code Coverage Results

You can view the total coverage of each build in the Status tab.

Image Added

Click the Parasoft Coverage tab to view the details of your code coverage. This tab has three sub-tabs for Overview, Overall Code Coverage, and Modified Code Coverage views.

Image Added

Image Added

Image Added

C/C++test Professional Reports

Code coverage reports for C/C++test Professional are not supported for versions prior to 2024.1.

Starting with version 2024.1, you can also use the command line option -property report.additional.report.dir=<REPORT_DIR> when generating the reports and use reports generated in this directory.

Anchor
ConfiguringQualityGates
ConfiguringQualityGates
Configuring Quality Gates

The Parasoft Jenkins plugin supports quality gates. Once configured, quality gate status information will be shown in the plugin.

Static Analysis

For static analysis, no additional configuration is required once you have defined your quality gates in Jenkins (refer to Quality gate configuration for more information about configuring quality gates in Jenkins). The status of the quality gate (Success, Unstable, or Failed) will be shown in the plugin and you can hover over the status icon for more details.

Image Added

Code Coverage

When configuring the settings of Parasoft Code Coverage, you can add a quality gate with the fields listed below. The specified reference build will be compared with the current build for any configured quality gates tasks.

  • Type: Choose the type to be used for the code coverage computation of this quality gate. There are two types available:
    • Overall project: Coverage of the whole project. This is an absolute value that might not change much from build to build.
    • Modified code lines: Coverage of the modified lines (for example, within the modified lines of a pull or merge request). This will focus on new or modified code only.
  • Threshold: Defines the minimum value of line coverage that is required to pass the quality gate. The range must be between 0 and 100, any value outside this range will be set to 0 or 100. The default value is 0.0, which will be used if this field is empty.
  • Stage or Build Result: When a quality gate fails, this property determines whether the result of the associated coverage stage will be marked as unstable or failed.

Image Added

For Pipeline jobs, add the configurations of quality gates in a pipeline script that calls the Parasoft Findings plugin. For example:

Code Block
titleScripted pipeline
node {
    stage('Publishing Code Coverage Results with Quality Gates') {
        recordParasoftCoverage (
            pattern: '**/coverage.xml',
            referenceBuild: '20',
            referenceJob: 'Demo', 
            sourceCodeEncoding: 'UTF-8', 
            coverageQualityGates: [
                [
                    criticality: 'NOTE',
                    threshold: 60.0, 
                    type: 'PROJECT'
                ]
            ]
        )
    }
}
Code Block
titleDeclarative pipeline
pipeline {
    agent any
    stages {
        stage('Publishing Code Coverage Results with Quality Gates') {
            steps {
                recordParasoftCoverage (
                    pattern: '**/coverage.xml',
                    referenceBuild: '20',
                    referenceJob: 'Demo', 
                    sourceCodeEncoding: 'UTF-8', 
                    coverageQualityGates: [
                        [
                            criticality: 'NOTE',
                            threshold: 60.0, 
                            type: 'PROJECT'
                        ]
                    ]

The Parasoft Jenkins plugin supports quality gates. Once configured, quality gate status information will be shown in the plugin.

Static Analysis

For static analysis, no additional configuration is required once you have defined your quality gates in Jenkins (refer to Quality gate configuration for more information about configuring quality gates in Jenkins). The status of the quality gate (Success, Unstable, or Failed) will be shown in the plugin and you can hover over the status icon for more details.

Image Removed

Code Coverage

When configuring the settings of Parasoft Code Coverage, you can add a quality gate with the fields listed below. The specified reference build will be compared with the current build for any configured quality gates tasks.

  • Type: Choose the type to be used for the code coverage computation of this quality gate. There are two types available:
    • Overall project: Coverage of the whole project. This is an absolute value that might not change much from build to build.
    • Modified code lines: Coverage of the modified lines (for example, within the modified lines of a pull or merge request). This will focus on new or modified code only.
  • Threshold: Defines the minimum value of line coverage that is required to pass the quality gate. The range must be between 0 and 100, any value outside this range will be set to 0 or 100. The default value is 0.0, which will be used if this field is empty.
  • Stage or Build Result: When a quality gate fails, this property determines whether the result of the associated coverage stage will be marked as unstable or failed.

Image Removed

For Pipeline jobs, add the configurations of quality gates in a pipeline script that calls the Parasoft Findings plugin. For example:

Code Block
pipeline {
  agent any
  stages {
    stage('Parasoft coverage') {
      steps {
        recordParasoftCoverage  coverageQualityGates: [[criticality: 'UNSTABLE', threshold: 60.0, type: 'PROJECT']], pattern: '**/coverage.xml', referenceBuild: '20', referenceJob: 'Demo', sourceCodeEncoding: 'UTF-8'
 )
            }
     }
  }
} 

The status and details of quality gates (Success, Unstable, or Failed) will be shown in the table in Summary page.

Image Removed

C/C++test Professional Reports

Code coverage reports for C/C++test Professional are not supported.

Third-party Acknowledgements

The Parasoft Findings Plugin for Jenkins uses the following third-party software:

Apache Ant Core

This software is used under an Apache License 2.0 with this notice.

Apache Ant Launcher

This software is used under an Apache License 2.0 with this notice.

Apache Commons Codec

This software is used under an Apache License 2.0 with this notice.

Apache Commons Collections

This software is used under an Apache License 2.0 with this notice.

Apache HttpClient

This software is used under an Apache License 2.0 with this notice.

Apache HttpClient5

This software is used under an Apache License 2.0 with this notice.

Apache HttpClient Fluent API

This software is used under an Apache License 2.0 with this notice.

Apache HttpClient Mime

This software is used under an Apache License 2.0 with this notice.

Apache HttpComponents Core HTTP/1.1

This software is used under an Apache License 2.0 with this notice.

Apache HttpComponents Core HTTP/2

This software is used under an Apache License 2.0 with this notice.

 }
    }
}

The parameters passed to coverageQualityGates:

  • criticality: Determines the result of the coverage stage. Options: 'NOTE', 'UNSTABLE', 'ERROR' or 'FAILURE'.
  • threshold: Specifies the minimum line coverage required to pass the quality gate. The range must be between 0 and 100.
  • type: Determines the type of code coverage computation for this quality gate. Options: 'PROJECT' or 'MODIFIED_LINES'.

The status and details of quality gates (Success, Unstable, or Failed) will be shown in the table in Summary page.

Image Added

Troubleshooting

Can't write coverage paint of 'Xxx‘ to zipped source file ’Xxx'

Panel

[Parasoft Coverage] [-ERROR-] Can't write coverage paint of 'Xxx' to zipped source file 'Xxx' due to an exception: MalformedInputException: Input length = 1

This error occurs when there is a mismatch between the Source Code Encoding configured in Jenkins and the charset used in your source code. To resolve this:

  1. Check Jenkins Settings: Confirm that the Source Code Encoding option in the Jenkins settings aligns with the encoding charset of your source code files. If this option isn't configured, Jenkins defaults to UTF-8.
  2. Adjust File Encoding:
    • If the error affects only a single file, consider changing the encoding charset of that file to match your Jenkins settings.
    • If the error persists in all files of the project, it's recommended that you update the Source Code Encoding option in the Jenkins settings to match the encoding of your source code files.

Third-party Acknowledgements

The Parasoft Findings Plugin for Jenkins uses the following third-party software:

Apache Ant

...

This software is used under an Apache License 2.0 with this notice.

Apache

...

Ant Launcher

This software is used under an Apache License 2.0 with this this notice.

Apache

...

HttpClient

This software is used under an Apache License 2.0 with this this notice.

Apache

...

HttpClient5

This software is used under an Apache License 2.0 with  with this notice.

...

Apache HttpClient Fluent API

...

This software is used under aan MIT License.

...

Apache License 2.0 with this notice.

Apache HttpCore5

This software is used under aan MIT Apache License 2.

...

0 with this notice.

Apache HttpCore5-h2

This software is used under an Apache License 2.0 with this notice.

...

Code Coverage API Plugin

This software is used under a CDD 1.0 MIT License.

...

Coverage Model

This software is used under a CDD 1.1 under a MIT License.

...

FindBugs JSR305

This software is used under a CDD 1.1 License.

...

an Apache License 2.0.

jackson-databind

This software is used under a GNU LGPLv3 License.

...

an Apache License 2.0 with this notice.

jsoup Java HTML Parser

This software is used under a Mozilla Public License 2.0MIT License.

Plexus Classworlds

This software is used under an an Apache License 2.0.

Saxon-HE

This software is used under a Mozilla Public License 2.0.

SpotBugs Annotations

This software is used under a GNU LGPLv2.1 License.

W3C License

This software is used under a W3C license for xmlresolver-data

XML Resolver

This software is used under an Apache License 2.0 with  with this notice.