In this section:
The Parasoft Findings Plugin for Jenkins allows you to visualize static analysis, test, and code coverage results, including support for quality gates, in Jenkins. It converts XML reports generated by Parasoft products into trend graphs and enables you to conveniently view the details or easily navigate to rule documentation. The plugin can be used with Freestyle, Maven, and Pipeline jobs.
The plugin can consume the following report types:
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 Version | Jenkins Version | Warnings NG Version |
---|---|---|
10.7.2 | 2.426.3+ | 11.0.0+ |
10.6.3 | 2.387.3+ | 10.5.1+ |
10.6.2 | 2.387.1+ | 10.0.3+ |
10.5.3 | 2.289.1+ | 9.10.3+ |
10.4.4 | 2.138.4+ | 8.x |
10.4.3 | 2.138.4+ | 6.x |
10.4.2 | 2.89.1+ | 4.x |
10.4.1 | 1.625.1+ | N/A |
Previous versions are available from the Jenkins plug-in releases section.
Refer to the Publishing Static Analysis Results for 10.4.1 section for usage.
xUnit is required to publish unit test results.
Java 11 JDK and Maven 3.8.1+ are required to build the plugin.
Since 10.4.2, this plugin has been integrated with the Warnings Next Generation Plugin to visualize static analysis results. Make a copy of all your job configuration settings prior to upgrading from a previous version of the Parasoft Findings Plugin for Jenkins. All settings from previous versions, such as the location of the report.xml files, will be lost after upgrading. You will need to re-apply your configuration settings after the upgrade.
The simplest installation method is to use the Jenkins plugin UI:
Alternatively, you can download the plugin from Parasoft's GitHub repository and follow the instructions to build the plugin as an HPI file (plugin format for Jenkins): https://github.com/jenkinsci/parasoft-findings-plugin. After creating the HPI file, you can deploy the plugin through the Jenkins web UI or through the command line.
See the Jenkins documentation for command line installation. Restart Jenkins after installing the plugin.
Parasoft Findings supports Maven, Freestyle, and Pipeline jobs. See Viewing Static Analysis Findings for a description of the graphs and reports generated by the Parasoft Findings Plugin.
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:
node { stage('Publishing Static Analysis Results') { recordIssues ( tools: [ parasoftFindings ( pattern: '**/report.xml', localSettingsPath: 'settings.properties' ) ] ) } } |
pipeline { agent any stages { stage('Publishing Static Analysis Results') { steps { recordIssues ( tools: [ parasoftFindings ( pattern: '**/report.xml', localSettingsPath: 'settings.properties' ) ] ) } } } } |
The parameters passed to parasoftFindings:
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.
Jenkins Pipeline is a suite of plugins that support implementing and integrating continuous delivery pipelines into Jenkins. See the Jenkins documentation for additional information about pipelines.
To publish static analysis results using a pipeline job, add a step to the pipeline script to call the Parasoft Findings publisher class or use the symbolic name:
step([$class: 'ParasoftPublisher', useReportPattern: true, reportPattern: '*.xml', settings: '']) |
or
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 |
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 to link the source code if it is stored in the Jenkins workspace. You can enable this option on the command line by setting the report.location_details=true
property in the settings file.
You can display static analysis rule documentation in the reports generated by the plugin.
You can either display the local rule documentation or the documentation stored in DTP.
Connect your tool to DTP by configuring the dtp.url
setting in your tool's .properties file. For example, dtp.url=
https://<HOST>:<PORT>
.
Note: Only DTP 2023.1 or later is supported.
For local documentation, set the report.rules
property to the directory that contains the analyzer documentation. For example: report.rules=<TOOL_INSTALL>/rules/doc
This section describes the graphs and reports generated by the current version of the Parasoft Findings Plugin. See Viewing 10.4.1 Findings if you are using the older version of the plug-in.
The Parasoft Warnings Trend graph appears on the project's homepage. The graph provides an overview of the analysis history.
You can hover your pointer over a point in the graph to view details. Click on the graph to open the Parasoft Warnings page.
This page contains the Overview widget, History widget, and Details report.
The Overview widget has a Severity Distribution mode that shows the reported violation's severities as color-coded wheel segments. The segments are proportional to the total number of violations in the report. You can hover your pointer over a segment to view details.
Click the next or previous arrow to switch to Reference Comparison mode.
The Reference Comparison mode that shows the status of violations as new reports are generated.
Click the next or previous arrow to switch to Severities Distribution mode.
If you zoom out on the webpage, the Overview widget will disappear, and the Severity Distribution and Reference Comparison widgets will be shown.
The History widget has three modes for viewing different aspects of the change in violations. The severity mode shows the change in violations according to their severity. Hover your pointer over an area in the graph to view details.
Click the next or previous arrow to switch to a different mode.
The total violations mode shows the change in total number of violations. Hover your pointer over an area in the graph to view details.
Click the next or previous arrow to switch to a different mode.
The new and fixed mode shows the change in violations according to their status. Hover your pointer over an area in the graph to view details.
For all modes, you can click the setting icon to choose the unit of the x-axis to be date or build.
You can also click and drag the ends of the slider to narrow the range of dates or builds included in the widget.
The Details report shows details about how violations are distributed across the project.
Click on the tabs and cross-links to explore different aspects of the violations data.
Static analysis trend graphs display results organized by the module, rule category or severity.
You can review the findings in the source code and navigate to rule documentation.
You can publish unit test results from Maven, Freestyle, and Pipeline job executions.
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:
node { stage('Publishing Test Execution Results') { xunit ( tools: [[$class: 'ParasoftType', pattern: '**/report.xml']] ) } } |
pipeline { agent any stages { stage('Publishing Test Execution Results') { steps { xunit ( tools: [[$class: 'ParasoftType', pattern: '**/report.xml']] ) } } } } |
node { stage('Publishing SOATest Results') { xunit ( tools: [[$class: 'ParasoftSOAtest9xType', pattern: '**/report.xml']] ) } } |
pipeline { agent any stages { stage('Publishing SOATest Results') { steps { xunit ( tools: [[$class: 'ParasoftSOAtest9xType', pattern: '**/report.xml']] ) } } } } |
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.
The test execution trend graphs shows test status, execution time, and stack trace for test failures.
You can publish code coverage from Maven, Freestyle, and Pipeline job executions.
To publish code coverage using a pipeline job, add a step to call the Parasoft Findings plugin. For example:
node { stage('Publishing Code Coverage Results') { recordParasoftCoverage ( pattern: '**/coverage.xml', referenceBuild: '20', referenceJob: 'Demo', sourceCodeEncoding: 'UTF-8' ) } } |
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:
Alternatively, you can generate a script of Parasoft Findings Plugin by Pipeline Syntax:
You can view the total coverage of each build in the Status tab.
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.
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.
The Parasoft Jenkins plugin supports quality gates. Once configured, quality gate status information will be shown in the plugin.
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.
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.
For Pipeline jobs, add the configurations of quality gates in a pipeline script that calls the Parasoft Findings plugin. For example:
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' ] ] ) } } |
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 parameters passed to coverageQualityGates:
The status and details of quality gates (Success, Unstable, or Failed) will be shown in the table in Summary page.
|
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:
The Parasoft Findings Plugin for Jenkins uses the following third-party software:
This software is used under an Apache License 2.0 with this notice.
This software is used under an Apache License 2.0 with this notice.
This software is used under an Apache License 2.0 with this notice.
This software is used under an Apache License 2.0 with this notice.
This software is used under an Apache License 2.0 with this notice.
This software is used under an Apache License 2.0 with this notice.
This software is used under an Apache License 2.0 with this notice.
This software is used under a MIT License.
Coverage Model
This software is used under a MIT License.
This software is used under an Apache License 2.0.
This software is used under an Apache License 2.0 with this notice.
This software is used under a MIT License.
This software is used under an Apache License 2.0.
This software is used under a Mozilla Public License 2.0.
This software is used under a GNU LGPLv2.1 License.
This software is used under an Apache License 2.0 with this notice.