Usage
To use the DevOps Test Hub plug-in, the plug-in must be loaded and an instance created before you can configure the plug-in integration. Configuration properties are defined using the product user interface or a JSON file. After the integration is complete, to invoke the plug-in send an HTTP Post request to the plug-in endpoint.
Integration type
The DevOps Test Hub plug-in supports endpoint integration which are listed in the following table.
Endpoints
Name |
Path |
Method |
OneTestEndpoint |
onetest/callback |
Post |
Invoking the plugin
You will need to "install" the plug-in in DevOps Velocity. You can do this in one of two ways. Perhaps the easiest way is to create a new Value Stream in DevOps Velocity. You can use the following template for creating your integration.
"integrations": [
{
"type": "ucv-ext-onetest-server",
"tenant_id": "<tenant-id>",
"name": "<integration-name>",
"logginglevel": "INFO",
"properties":{
"userAccessKey": "<ucv-user-access-key>",
"oneTestUrl" : "<devops test-hub-url="">",
"oneTestRefreshToken":"<devops test-hub-refresh-token="">",
"buildRegExp": "([A-Z]+-[0-9]+)",
"workflowId" : "<value_stream_id>"
}
}
]
- In the above example, provide all of your own values for the values inside of < > brackets.
- The buildRegExp field can be used to map a build to a metric. The tags on the DevOps Test Hub test will be evaluated against the regular expression.
- For instance, if your buildRegExp is defined as "([A-Z]+-[0-9]+)" and you tag your test with "BUILD-123" this will map the build with ID BUILD-123 in the Velocity server to the newly created metric.
- For help forming a regular expression based on your build ID, you can test out patterns at the following web page: https://regexr.com
- Another option for creating is to hit the https:///integration url with the integration definition as your payload:
{
"type": "ucv-ext-onetest-server",
"tenant_id": "<tenant-id>",
"name": "<integration-name>",
"logginglevel": "INFO",
"properties":{
"oneTestUrl" : "<devops test-hub-url="">",
"oneTestRefreshToken":"<devops test-hub-refresh-token="">",
"buildRegExp": "([A-Z]+-[0-9]+)",
"workflowId" : "<value_stream_id>"
}
}
- Either option will allow you to create an DevOps Test Hub integration instance.
After going through the "Set Up" portion above, you can send an HTTP POST request to your new endpoint: https:///pluginEndpoint//onetest/callback
- The payload for this POST must be in the following format
{
"project": {
"name":"",
"id": ""
(either project name or project id must be specified)
},
"test": {
"name":"",
"path":""
(either test name or test path must be specified)
},
"commitId": "" (optional),
"build": {
"id": "",
"url": ""
} (optional, this will override buildRegExp if specified)
}
Integration
To install the plug-in, perform the following steps:
- In HCL DevOps Velocity, click Settings > Integrations > Available.
- In the Action column for the DevOps Test Hub, click Install.
There are two methods to integrate the plug-in:
- Using the user interface
- Using a JSON file
The tables in the Configuration Properties section describe the properties used to define the integration.
To integrate the plug-in using the user interface, perform the following steps:
- In HCL DevOps Velocity, click Settings > Integrations > Installed.
- In the Action column for the DevOps Test Hub plug-in, and then click Add Integration.
- On the Add Integration dialog, enter the values for the fields to configure the integration and define communication.
- Click Add.
Integrating the plug-in by using JSON file
The JSON file contains the information for creating a value stream. Within the JSON file is a section for integrations. It is in this section that plugin properties can be defined. Refer to the JSON sample code in the Set Up section.
To integrate the plug-in using a JSON, perform the following steps:
- Navigate to value stream page, and then click the necessary value stream.
- Click
icon, and then Select Edit value stream to modify the JSON file in the code or tree view editors.
Alternatively, you can also click Download JSON option to download the JSON file, and then select the Import JSON option to upload the revised JSON file.
- Edit the integration information in the JSON file to add the plug-in configuration properties. Refer to JSON sample code in the Configuration Properties section for more details.
- Click Save.