Page tree

Skip to end of metadata
Go to start of metadata

In this section:

Introduction

The Parasoft Findings Plugin for Jenkins allows you to visualize static analysis and test results in Jenkins. The plug-in can be used with types of jobs supported by XUnit and the Warnings Next Generation plug-in, including Freestyle, Maven, and Pipeline jobs. Refer to the Warnings Next Generation documentation for details: https://github.com/jenkinsci/warnings-ng-plugin/blob/master/doc/Documentation.md

The Parasoft Findings plugin can consume the following report types:

  • Functional test reports generated by Parasoft SOAtest 9.x.
  • Static analysis, metrics analysis, and unit test reports generated by 10.x versions of C/C++test, Jtest, and dotTEST.   

Requirements

The latest version of the Parasoft Findings Plugin is compatible with Jenkins 2.89.1 and later. The plug-in integrates with the Warnings Next Generation plug-in to report Parasoft code analysis results. 

If you are using Jenkins 1.625.1 to 2.73.3, you can use Parasoft Findings Plugin 10.4.1, which is available from the Jenkins plug-in archive directory:

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

xUnit is required to publish unit test results. 

Java 8 JDK and Maven 3 are required to build the plugin.

Upgrading to 10.4.2

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.

Installation

The simplest installation method is to use the Jenkins plugin UI:

  1. Choose Manage Jenkins> Manage Plugins> Available.
  2. Locate and enable Parasoft Findings Plugin for Jenkins.
  3. Click Download now and install after restart

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. 

Web UI

  1. Choose Manage Jenkins> Manage Plugins from the Jenkins menu and click the Advanced tab.
  2. In the Upload Plugin section, click Choose File and choose parasoft-findings.hpi.
  3. Click Upload.
  4. Restart Jenkins.

Command Line

See the Jenkins documentation for command line installation. Restart Jenkins after installing the plugin. 

Publishing Static Analysis Results

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.

Maven and Freestyle Jobs

  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.
  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 Links 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.

Pipeline Jobs

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 {
	recordIssues enabledForFailure: true, 
	aggregatingResults: false, 
	tool: parasoftFindings(
		pattern: '**/*.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

  1. Enable the Publish Parasoft analysis results option. 
    • For Maven jobs, choose Configure> Build Settings and enable the Publish Parasoft analysis results option. 
    • For Freestyle jobs: 
      1. Choose Configure> Post-build Actions> Add post-build action
      2. Choose Publish Parasoft analysis results from the drop-down menu.
  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 step and is useful when Jenkins and the directory for the report.xml file are both on the local machine.

Pipeline Jobs

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

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. 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 plug-in.

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

Documentation in DTP

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

  • dtp.server 
  • dtp.port 
  • dtp.user 
  • dtp.password

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

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. 
     
  3. Click Add.
  4. Choose ParasoftAnalyzers-10.x or ParasoftSOAtest-9.x. 
     
  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

step(\[$class: 'XUnitBuilder', tools: \[\[$class: 'ParasoftType', pattern: ''\]\]\])

ParasoftSOAtest-9.x

step(\[$class: 'XUnitBuilder', tools: \[\[$class: 'ParasoftSOAtest9xType', pattern: ''\]\]\])

C/C++test 10.x Unit Test Results

C/C++test 10.x 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. 

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.

 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. 

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.

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 date or build number buttons to switch the unit of the x-axis to 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. 

Details Report

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.

Viewing 10.4.1 Findings   

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.

Viewing Test Execution Results

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




  • No labels