This workflow accepts any parameter URL from DTP's Explorer views (Test Explorers and Violations Explorers) and passes the parameters to the DTP REST API so that it can query the test cases and generate a CSV output.

In this section:

Requirements

  • This artifact is only supported in DTP Enterprise Pack 5.3.2 and is deprecated in 5.3.3.
  • This artifact is only supported in DTP 5.3.2 and is deprecated in 5.3.3. See Server Settings.

Installation

See Downloading and Installing Artifacts for instructions on installing DTP Enterprise Pack extensions.

Available Endpoints

The workflow provides endpoints specific to the service. To get the endpoint URLs, click on the category in which the artifact is running and expand the appropriate services.

Customization

The Convert Results to Data needed for CSV function node constructs a msg.payload object array for the CSV node to accept.

The CSV node header columns list must be used to construct a new msg.payload object array.

The two items must be in sync. Review the DTP REST API documentation to become familiar with how to customize CSV output from the violation or test case data.  

Any fields returned from the /dynamicAnalysisTestCases and /staticAnalysisViolations APIs can be included in CSV output.

DTP Test Case Explorer

The  /dynamicAnalysisTestCases API returns data from the Test Explorer.

Populate the request parameters with URL parameters and click Send Request to view the output.

In the Convert Results to Data needed for CSV node, the values in the csvEntry variable must match the fields specified in the API. For example, if you want to add branch from the resource to be exported. You would add a branch column name  and assign a value. Each test case will be under the testCase variable and the branch will be under the testCase.resource object.

Edit the CVS node and add branch to the Columns field. 

DTP Violations Explorer

The /staticAnalysisViolations API returns data from the Violations Explorer.

As with the Test Case Explorer, any output from this API can be exported to CSV. See DTP Test Case Explorer for details.

Example

  1. In Report Center, click Search in the Test Explorer and configure the search options (see Test Explorer). The search parameters are passed to the URL. For example:

    http://<DTP Server>:8080/grs/dtp/explorers/test?filterId=71&buildId=parabank-cbt&action=Retest
     
  2. Note the URL and click on the Services tab in Extension Designer.  
  3. Get the endpoints from the services category page (see Available Endpoints):
  4. Run CURL or make an HTTP request to the endpoint with the parameters in your URL. For example:

    curl http://localhost:8321/slices/d3cbc19d.a299d?filterId=71&buildId=parabank-cbt&action=Retest

    Use HTTP(S)-compliance Parameters

    When adding your parameters, be sure to properly encode the string parameter values if they contain spaces, +, /, or any other characters that are not allowed in the HTTP(S) protocol.

    The following parameter, for example, is not allowed and will prevent the artifact from functioning correctly: buildId=c++test. The encoded parameter would be buildId=C%2D%2Dtest.

    You can use an encoding tool (e.g., http://www.url-encode-decode.com) to help you properly encode parameters to be compliant with the standard.

     

  5. If you want to reroute the output stream as a CSV file, use a request such as the following:

    curl "http://localhost:8321/slices/d3cbc19d.a299d?filterId=71&buildId=parabank-cbt&action=Retest" > retest-7-parabank-cbt.csv
  • No labels