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

  • Functional test reports generated by Parasoft SOAtest 9.x.
  • Static analysis and unit test reports generated by C/C++test 10.x Desktop and DTP Engines 10.x (C/C++test, Jtest, and dotTEST).   

Requirements

  • Jenkins 1.625.1 or later is required to use the plugin.
  • Java 7 JDK and Maven 3 are required to build the plugin

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. 

Configuration

You can use the plugin with new and existing Jenkins jobs.

Publishing Static Analysis Results

  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.

    C++test 10.x Desktop Report Settings

    C++test 10.x Desktop reports for static analysis must be generated with the Add absolute file paths to XML data option 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.

  4. Configure access to the rule documentation in your settings file.
    1. Connect to DTP to access online documentation by setting the following properties: 
      • dtp.server 
      • dtp.port 
      • dtp.user 
      • dtp.password
    2. For local documentation, set the report.rules property to the directory that contains the analyzer documentation. For example:
      report.rules=<engine-location>/rules/doc

Publishing Test Execution Results for 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.

    C++test 10.x Desktop Unit Test Results

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

Publishing Findings for 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. 

Static Analysis

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:

useReportPatternReport location option
reportPattern File pattern field
settingsSettings field

Unit and Functional Tests

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: '']]])

Viewing Static Analysis 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.

Parasoft Findings for Jenkins - Modules tab

Viewing Test Execution Results

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

Change Log

10.3.6

Fixed an issue related to resolving environment variables when static analysis results are imported.

10.3.5

Added support for static analysis and unit test results for C++test 10.x Desktop.

Added support for pipelines.

10.3.4

Fixed wrong number of test results reported in some cases.

Fixed handling error messages and stack traces for tests having multiple failures.

Fixed missing "time" attributes not handled properly.

Fixed not using correct "time" attribute in some cases.

10.3.3Updated Parasoft Services to 10.3.3.
10.3.2

Fixed the issue with Parasoft Findings Plugin not working with analysis-core version 1.82.

Updated Parasoft Services to 10.3.2.

10.3.0

Added publishing functional test results from Parasoft SOAtest 9.x reports.

Updated Parasoft Services to 10.3.0.

10.2.3.1

Fixed an issue with visualization of parameterized test results.

Updated Parasoft Services to 10.2.3.

10.2.2Initial release based on Parasoft Services 10.2.2.
  • No labels