Deleting old test results by using the command line

You can delete old test suite results by using the HCL OneTest API command line.

The syntax to use is as follows:
IntegrationTesterCmd Options delete-all-results-keeping  Arguments 

Here are some examples:

To delete all test suite results that are more than 6 months old, use the following command:
IntegrationTesterCmd --databaseURL jdbc:db2://localhost:50000/resultdb 
            --dbuser jkelly --password hayling delete-all-results-keeping P6M
To delete all project Proj1 test suite results that are more than 7 days old use the following command:
IntegrationTesterCmd --project "C:\Users\jkelly\MyProjects\Proj1\Proj1.ghp" delete-all-results-keeping P7D
Warning: After you delete all test results and project data in the results database, you must restart any HCL OneTest API workbench instances or HCL OneTest API Agent instances that were using that results database. 

The following table lists the options that you can use with the IntegrationTesterCmd command for deleting test results older than a specified period.

Table 1. List of available options
Options Description
--project/-p Path to project file (optional). Used to limit the deletion to test suite results to a specific project. If not specified then databaseUrl, dbuser, and password are required options.
--databaseUrl/-b Results database URL (optional). For more information on the specification of database URLs when using IP literal addresses, see IP literal address.
--dbuser/-g Results database user name (optional)
--password/-h Results database password (optional)
--ignorePolicy/-y If present, the archive policy is ignored (flag).
--stubResults/-z If present, stub results are deleted (flag).
Table 2. List of available arguments
Arguments Description
duration A representation of a time period of the form PnYnMnDTnHnMnS, using the World Wide Web Consortium (W3C) timeDuration specification. For example, to delete all results older than 6 months use P6M
Note: Results that are associated with a test cycle will be deleted only if the test cycle is closed.