Filters

CLEAR ALL

Search Results ()

Filter Icon

Search Results ()

    All Plugins (172)

    Filter Icon

    Quick Info

    Product icon
    Product
    DevOps Velocity (HCL Accelerate)
    Plugin type icon
    Type
    plugin
    Compatibility icon
    Compatibility
    HCL DevOps Velocity version 2.0 or later
    created by icon
    Created by
    HCL Software
    Website icon
    Website
    Published Date
    March 18th, 2021
    Last Updated
    March 29th, 2024

    Description

    TestNG is a testing framework for Java programming

    Quick Info

    Product icon
    Product
    DevOps Velocity (HCL Accelerate)
    Plugin type icon
    Type
    plugin
    Compatibility icon
    Compatibility
    HCL DevOps Velocity version 2.0 or later
    created by icon
    Created by
    HCL Software
    Website icon
    Website
    Published Date
    March 18th, 2021
    Last Updated
    March 29th, 2024

    ucv-ext-testng:1.0.38.tar

    Uploaded: 31-May-2022 16:32

    Pull Command

    docker pull hclcr.io/accelerate/ucv-ext-testng:1.0.38

    Release Notes

  • Reduced Vulnerabilities
  • ucv-ext-testng:1.0.13.tar

    Uploaded: 08-Feb-2021 07:43

    Pull Command

    docker pull hclcr.io/accelerate/ucv-ext-testng:1.0.13

    Release Notes

  • Plugin name update
  • Summary

    The TestNG plug-in provides for integration with a TestNG server. Data is uploaded to the HCL DevOps Velocity server using an HTTP Post request.

    Compatibility

    HCL DevOps Velocity version 2.0 or later

    History

    The following table describes the changes made in each plugin version.

    Plugin history details
    Version Description
    1.0.13 Bug fix

    Usage

    To use the TestNG plug-in, the plug-in must be loaded and an instance created. Load the plug-in into the HCL DevOps Velocity container if necessary. From the user interface, click Settings > Integrations > Plugins. On the Plugins page, locate the plug-in and click Load Plugin. To create an instance, locate the plug-in and click Install. The plug-in is now listed below those plug-ins to be installed and available for invoking.

    Integration type

    The TestNG plug-in is a parser type plug-in. It parses TestNG data sent in a JSON or XML file.

    Invoking the plug-in

    To gather data from the TestNG server, send an HTTP Post request with the data to parse. Whenever a there is a hit to the endpoint, the data is parsed and displayed as metrics in HCL DevOps Velocity. You can use various methods such as Postman, REST calls, CURL, and CI/CD tools like Jenkins to invoke the plug-in endpoints.

    Invoke using Jenkins plug-in

    Install the DevOps Velocity plug-in into your Jenkins server. In your freestyle job or pipeline use the UCV-Upload Metrics File to DevOps Velocity step and provide the required fields. This step allows your build job to upload generated coverage results files to HCL DevOps Velocity.

    
    pipeline {
       agent any
       stages {
          stage('testNGMetrics') {
             steps {
                step([$class: 'UploadMetricsFile',  appName: 'My TestNG Test', dataFormat: '<testngJSON or testngXML>', filePath: '<location of the testng report>', name: 'my-testng-test', pluginType: 'testng', tenantId: '<tenant Id>', testSetName: 'testng', metricsRecordUrl: "${env.BUILD_URL}"])
             }
          }
       }
    }
    

    Invoke using a Rest call

    When using a REST call to invoke the Code Coverage plug-in, it must be a POST method and include the location of the HCL DevOps Velocity quality data endpoint.

    The following sample shows a REST call that you can copy and update as necessary. Key points about the sample:

    • The URL points to the HCL DevOps Velocity quality data endpoint. Update with the server location for your installation of HCL DevOps Velocity.
    • The BODY of the call is a multipart/form data. It includes information about the payload.
    
    METHOD: POST 
    URL: https://<url_hclaccelerate_server>/reporting-consumer/metrics
    BODY (multipart/form-data):
     {
      payload: <json_object_string> // See below for schema format
     testArtifact: <testng JSON/XML>
     }
    

    Invoke using Curl command to upload Unit Test & Functional Test results.

    Note: You can use JSON or XML format output file as input for curl command to update results to insights pages.

    For unit tests

    curl -k --request POST   --url https://<velocity.url>/reporting-consumer/metrics  --form 'payload={
      "tenant_id": "5ade13625558f2c6688d15ce",
      "application": {
      "name": "<application.name>"
    },
    "record": {
      "pluginType": "testng",
      "dataFormat": "testngXML",
          "recordName": "<record.name>",
          "metricDefinitionId": "Unit Tests"
    },
    "build": {
      "buildId": "<build.name>",
      "url": "<build.url>"
      }
    }
    '   --form testArtifact=@<unit.testresults.filename>
    For functional tests
    curl -k --request POST   --url https://<velocity.url>/reporting-consumer/metrics  --form 'payload={
    "tenant_id": "5ade13625558f2c6688d15ce",
    "application": {
    "name": "<application.name>"
    },
    "record": {
    "pluginType": "testng",
      "dataFormat": "testngXML",
    "recordName": "<record.name>",
          "metricDefinitionId": "Functional Tests"
    },
    "build": {
    "buildId": "<build.name>",
    "url": "<build.url>"
    }
    }
    '   --form testArtifact=@<functional.testresults.filename>
    

    Payload schema Example

    The following shows the schema for the payload.

    
    {
      "tenant_id": "<tenant_id>",    // required Tenant ID
      "metricName": "<metric_name>", // optional: name for recurring test set
      "application": {
        "name": "<application_name>"  //Name of application
      },
      "record": {
        "recordName": "<record_name>", // optional: Name for this record
        "executionDate": 1547983466015, // optional: UNIX Epoch
        "pluginType": "testng",
        "dataFormat": "<<data_type>",  // testngJSON or testngXML
        "metricsRecordUrl": "<Jenkins_build_url>" // optional: To link the Jenkins build with test results     
      },
      "build": {  // Optional: One of the following fields must be included 
        "buildId": "<build_id>",
        "jobExternalId": "<external_job_id>",
        "url": "<build_url>",
      },
      "commitId": "<commit_id>",  // optional
      "pullRequestId": "<pullrequest_id>", // optional
      "environment": "<environment_name>" // optional
    }