Versions Compared

Key

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

...

The Parasoft Findings Plugin for Jenkins allows you to visualize static analysis, test, and test results 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.

...

  • Functional test reports generated by Parasoft SOAtest 2020.1+.
  • Static analysis, metrics analysis, and unit test and code coverage reports generated by 2020.12+ versions of C/C++test, Jtest, and dotTEST.

...

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 Parasoft Findings Plugin.

Parasoft Findings VersionJenkins VersionWarnings NG Version
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 archive directoryreleases section.

Image RemovedImage Added

Refer to the Publishing Static Analysis Results for 10.4.1 section for usage.

...

  1. Open your Maven job and choose Configure> Post-build Actions.
  2. Choose Record compiler warnings and static analysis results from the Add post-build action menu.
  3. Choose Parasoft Findings from the Tool drop-down menu in the Static Analysis Tools section.
    Image RemovedImage Added
  4. 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.
  5. Enable the Skip Symbolic Linkssymbolic links when searching for files option if you do not want to include symbolic links.
  6. Specify an encoding character set in the Report Encoding field. Start typing in the field to begin auto-filling the character set.
  7. 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.
  8. (Optional) Specify a custom ID and custom name for the tool.
  9. If you are executing other tools, you can enable the Aggregate results option to aggregate the results into a single result. This is functionality native to the Warnings Next Generation plug-in.
  10. Enable the Run always option if you want to record results from failed builds, in addition to stable and unstable builds.
  11. Click Apply.

...

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:

No Format
node {
	  recordIssues(
 enabledForFailure: true, 
	aggregatingResults: false, 
	tool   tools: parasoftFindings(
		      pattern: '**/*.xml', 
		
      localSettingsPath: 'settings.properties'
	
    )
  )
}

Pass the following arguments to the parasoftFindings parameter:

...

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 static analysis must be generated with the Add absolute file paths to XML data option enabled if you are using C/C++test Professional 2023. You can 2 or later can be used directly to support navigation to 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, which allows you to navigate to the source code if it is not stored in the Jenkins workspace..

Displaying Rule Documentation

You can display static analysis rule documentation in the reports generated by the plugin.

Image RemovedImage Added

You can either display the local rule documentation or the documentation stored in DTP.

...

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

Publishing Test Execution Results

You can publish unit test results from Maven, Freestyle, and Pipeline job executions.

Freestyle and Maven Jobs 

  1. Choose Configure> Post-build Actions> Add post-build action.
  2. Choose Publish xUnit test result from the drop-down menu. 
    Image Removed 
  3. Click Add.
  4. Choose ParasoftAnalyzers-10.x or ParasoftSOAtest-9.x. 
    Image Removed 
  5. Specify a workspace-relative path to the report.xml file generated by Parasoft Analyzer in the Pattern field.

Pipeline Jobs

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
languagejava
step(\[$class: 'XUnitPublisher', tools: \[\[$class: 'ParasoftType', pattern: ''\]\]\])

ParasoftSOAtest-9.x

Code Block
languagejava
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 Static Analysis Findings

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. 

Parasoft Warnings Trend Graph

The Parasoft Warnings Trend graph appears on the project's homepage. The graph provides an overview of the analysis history. 

Image Removed

You can hover your pointer over a point in the graph to view details. Click on the graph to open the Parasoft Warnings page.

Parasoft Warnings

This page contains the Overview widget, History widget, and Details report.

Overview Widget

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.

Image Removed

 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.

Image Removed

Click the next or previous arrow to switch to Severities Distribution mode. 

History Widget

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.

Image Removed

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. 

Image Removed

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. 

Image Removed

For all modes, you can click the date or build number buttons to switch the unit of the x-axis to date or build.

 Image Removed

You can also click and drag the ends of the slider to narrow the range of dates or builds included in the widget. 

Image Removed

Details Report

The Details report shows details about how violations are distributed across the project. 

Image Removed

Click on the tabs and cross-links to explore different aspects of the violations data.

Viewing 10.4.1 Findings   

Static analysis trend graphs display results organized by the module, rule category or severity.
Image Removed
You can review the findings in the source code and navigate to rule documentation.

Image Removed

Image Removed

Image Removed

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

Third-party Acknowledgements

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

...

Viewing Static Analysis Findings

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. 

Parasoft Warnings Trend Graph

The Parasoft Warnings Trend graph appears on the project's homepage. The graph provides an overview of the analysis history. 

Image Added

You can hover your pointer over a point in the graph to view details. Click on the graph to open the Parasoft Warnings page.

Parasoft Warnings

This page contains the Overview widget, History widget, and Details report.

Overview Widget

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.

Image Added

 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.

Image Added

Click the next or previous arrow to switch to Severities Distribution mode. 

Image Added

If you zoom out on the webpage, the Overview widget will disappear, and the Severity Distribution and Reference Comparison widgets will be shown.

History Widget

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.

Image Added

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. 

Image Added

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. 

Image Added

For all modes, you can click the setting icon to choose the unit of the x-axis to be date or build.

 Image Added

You can also click and drag the ends of the slider to narrow the range of dates or builds included in the widget. 

Image Added

Details Report

The Details report shows details about how violations are distributed across the project. 

Image Added

Click on the tabs and cross-links to explore different aspects of the violations data.

Viewing 10.4.1 Findings   

Static analysis trend graphs display results organized by the module, rule category or severity.
Image Added
You can review the findings in the source code and navigate to rule documentation.

Image Added

Image Added

Image Added

Publishing Test Execution Results

You can publish unit test results from Maven, Freestyle, and Pipeline job executions.

Freestyle and Maven Jobs 

  1. Choose Configure> Post-build Actions> Add post-build action.
  2. Choose Publish xUnit test result from the drop-down menu. 
    Image Added 
  3. Click Add.
  4. Choose ParasoftAnalyzers-10.x or ParasoftSOAtest-9.x. 
    Image Added
  5. Specify a workspace-relative path to the report.xml file generated by Parasoft Analyzer in the Pattern field.

Pipeline Jobs

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
languagejava
step(\[$class: 'XUnitPublisher', tools: \[\[$class: 'ParasoftType', pattern: ''\]\]\])

ParasoftSOAtest-9.x

Code Block
languagejava
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 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 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 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:

  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

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
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 Added

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.

Apache HttpCore

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

Apache

...

HttpCore5

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

Apache

...

HttpCore5-h2

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

Apache

...

XmlResolver

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

...

 Apache License 2.0 with this notice.

Code Coverage API Plugin

This software is used under a MIT License.

Coverage Model

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

...

MIT License.

FindBugs

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

...

JavaBeans(TM) Activation Framework

This software is used under an Apache License 2CDD 1.0 with this noticeLicense.

...

JavaBeans Activation Framework

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

...

a CDD 1.1 License.

JavaMail

This software is used under an Apache License 2.0.

...

a CDD 1.1 License.

JCommon

This software is used under an Apache a GNU LGPLv3 License.

Mozilla Public License 2.0

...

This software is used under ana Apache Mozilla Public License 2.0 with this notice.

...

Plexus Classworlds

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

...

Saxon-HE

This software is used under a CDD 1Mozilla Public License 2.0 License.

...

SpotBugs Annotations

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

...

W3C License

This software is used under a GNU LGPLv3 License.

...

 W3C license for xmlresolver-data

XML Resolver

This software is used under an Apache License 2.0.

SpotBugs Annotations

This software is used under a GNU LGPLv2.1 License with this notice.