Jenkins : Compuware Xpediter Code Coverage Plugin

Plugin Information

View Compuware Xpediter Code Coverage on the plugin site for more information.

Overview

The Compuware Xpediter Code Coverage plugin allows Jenkins users to extract code coverage results from a Compuware code coverage repository. These results can then be viewed in SonarQube.

Prerequisites

The following are required to use this plugin:

  • Jenkins

  • Jenkins Credentials Plugin

  • Topaz Workbench CLI 18.2.4. Refer to the Topaz Workbench Installation Guide for instructions.

  • Host Communications Interface

  • Xpediter/Code Coverage 17.2, PTF PA01563
  • Compuware Shared Services 17.2, PTF CXS527A

To Extract Code Coverage Results from a Compuware Code Coverage Repository

  1. Install the Compuware Xpediter Code Coverage plugin according to the Jenkins instructions for installing plugins.

  2. In the Jenkins system configuration page's Compuware Configurations section, do one of the following:

    • In the Windows Topaz Workbench CLI home field, point to the Windows installation location of the CLI. If necessary, change the default values given to match the correct installation location.

    • In the Linux Topaz Workbench CLI home field, point to the Linux installation location of the CLI. If necessary, change the default values given to match the correct installation location.

    Note: The Topaz Workbench CLI must be installed on the machine that is configured to run the job.

  3. If no host connection appears in the Host Connections section, click Add Host Connection and add a host connection by entering the following information:

    • In the Description field, enter a description of the connection.

    • In the Host:port field, enter the z/OS host to connect to.

    • From the Encryption protocol list, select the desired encryption protocol to be used for this connection. The encryption protocol is used to encrypt data sent to and from the host. The default is 'None'.
    • From the Code page list, select the desired code page to be used for this connection. The code page is used to translate data sent to and from the host. The default is 1047.

    • In the Read/write timeout (minutes) field, enter the number of minutes for the plugin to wait for a response from the host before timing out.

    Note: Click Delete Host Connection to delete an existing connection.

  4. On the Configuration page of the job or project, in the Build section, from the Add build step list, select Retrieve Xpediter Code Coverage Statistics.

  5. From the Host connection list, select the host connection to be used to connect to the z/OS host. Alternatively, to add a connection, click Manage connections. The Host connections section of the Jenkins configuration page appears so a connection can be added.

  6. In the Login credentials field, select the stored credentials to use for logging onto the z/OS host. Alternatively, click Add to add credentials using the Credentials Plugin. Refer to the Jenkins documentation for the Credentials Plugin.

  7. Do one or both of the following:

    • In the Path to analysis properties field, enter the path to an existing ccanalysis.properties file, which is a properties file used to specify the source, repository, system, test, and DDIO override information for the code coverage extraction.

    • In the Analysis properties box, enter the parameters for the code coverage extraction, using the following syntax:

      • cc.sources= Indicate the relative path to the source directories to be used for the code coverage extraction.

      • cc.repos= Indicate the code coverage repository from which to extract code coverage data.

      • cc.system= Indicate the system to be included in the scan.

      • cc.test= Indicate the test ID to be included in the scan.

      • cc.ddio.overrides= Indicate the new location of the program's DDIO file if the file was moved or renamed from what is specified in the repository.

    Note: Parameters entered via the Analysis properties box override corresponding parameters in the ccanalysis.properties file.

  8. If desired, repeat the steps above to add more build steps.

  9. Click Save.

  10. Run the job, which creates a CodeCoverage.XML file containing the code coverage information for the selected programs. This file is located in a Coverage subdirectory in the Jenkins workspace. This file can be input into SonarQube to view the code coverage results.

  11. During the Execute SonarQube Scanner Step, add the following property to import the Coverage data into SonarQube. “sonar.coverageReportPaths=Coverage/CodeCoverage.xml"

Using Pipeline Syntax to Generate Pipeline Script

  1. Do one of the following:

    • When working with an existing Pipeline job, click the Pipeline Syntax link in the left panel. The Snippet Generator appears.

    • When configuring a Pipeline job, click the Pipeline Syntax link at the bottom of the Pipeline configuration section. The Snippet Generator appears.

  2. From the Sample Step list, select General Build Step.

  3. From the Build Step list, select Retrieve Xpediter Code Coverage Statistics.

  4. Complete the remaining fields.

  5. Click Generate Pipeline Script. The Groovy script to invoke the Compuware Xpediter Code Coverage plugin appears. The script can be added to the Pipeline section when configuring a Pipeline job. A sample script is shown below:

    stage("Collect Code Coverage")
    {
        node{
            step([$class: 'CodeCoverageBuilder',
            analysisProperties: '''cc.sources=PLAY
            cc.repos=CPWR.CODECOV.REPOSIT
            cc.system=SYSTEM1
            cc.test=TEST1
            cc.ddio.overrides=''',
            analysisPropertiesPath: '',
            connectionId: '63e55263-8d69-4e1c-a91a-baf98ea15745',
            credentialsId: 'eaa1931a-1a63-46f3-ae4a-9729446eb326'])
        }
    }

Known Limitations

  • Source code must be compiled using the Compuware Shared Services(CSS) pre-processor.
    • Other pre-processors can cause changes to the original source file that are undetectable to CSS.
  • Nested copybooks within the procedure division are not supported.
  • COBOL COPY REPLACING statements in the procedure division may cause source mismatches.

Product Assistance

Compuware provides assistance for customers with its documentation, the FrontLine support web site, and telephone customer support.

FrontLine Support Web Site

You can access online information for Compuware products via our FrontLine support site at https://go.compuware.com. FrontLine provides access to critical information about your Compuware products. You can review frequently asked questions, read or download documentation, access product fixes, or e-mail your questions or comments. The first time you access FrontLine, you must register and obtain a password. Registration is free.

Compuware also offers User Communities, online forums to collaborate, network, and exchange best practices with other Compuware solution users worldwide. Go to http://groups.compuware.com/ to join.

Contacting Customer Support

At Compuware, we strive to make our products and documentation the best in the industry. Feedback from our customers helps us maintain our quality standards. If you need support services, please obtain the following information before calling Compuware's 24-hour telephone support:

  • The name, release number, and build number of your product. This information is displayed in the About dialog box.

  • Installation information including installed options, whether the product uses local or network databases, whether it is installed in the default directories, whether it is a standalone or network installation, and whether it is a client or server installation.

  • Environment information, such as the operating system and release on which the product is installed, memory, hardware and network specification, and the names and releases of other applications that were running when the problem occurred.

  • The location of the problem within the running application and the user actions taken before the problem occurred.

  • The exact application, licensing, or operating system error messages, if any.

You can contact Compuware in one of the following ways:

Phone

  • USA and Canada: 1-800-538-7822 or 1-313-227-5444.

  • All other countries: Contact your local Compuware office. Contact information is available at https://go.compuware.com.

Web

You can report issues via FrontLine.

Note: Please report all high-priority issues by phone.

Mail

Customer Support
Compuware Corporation
One Campus Martius
Detroit, MI 48226-5099

Corporate Web Site

To access Compuware's site on the Web, go to https://www.compuware.com. The Compuware site provides a variety of product and support information.

Change Log

Version 1.0.5

Version 1.0.4

This release requires Topaz Workbench CLI version 19.04.01 or higher.

  • Added support for encryption protocol for a host connection.

Version 1.0.3

  • Corrected logging for when an analysis properties file is not specified.

Version 1.0.2

  • Fixed the help links for the Code Coverage configuration fields.

Version 1.0.0

  • Added the ability to extract Code Coverage statistics from a Compuware Code Coverage Repository.