Managing retention rules
You can create, edit, and delete retention rules to automatically manage and clean up outdated or no longer needed test result data. This ensures that outdated or unnecessary results are managed and storage is optimized.
Before you begin
You must have been assigned the Team Space Owner role in Test Hub.
About this task
- Delete the entire result, removing it from the system completely
- Delete only the test log and report data, reducing disk usage while keeping result metadata
Procedure
-
Log in to Test Hub.
The Projects page of the initial team space is displayed.
-
Click .
The Resources page is displayed.
-
Click the Rules tab.
The Rules page displays the following retention rules for the team space:
-
Delete Stale Branches: Deletes test results created on Git branches that no longer exist and are older than 3 days. For example, results from branch edits or Git cleanup.
-
Delete Old Stub Results: Deletes results of type APISTUB that are older than 30 days.
Note: You can disable these default rules if required.
Task Action Enabling or Disabling default retention rule Perform the following steps:
-
Click the Enabled button to enable or disable the rules.
The Enable Retention Rule dialog is displayed.
- Click Ok to confirm your action.
Adding retention rule Perform the following steps:
-
Click Add Rule.
The New Retention Rule dialog is displayed.
-
Enter a name in the Rule Name field.
-
Select the conditions from the drop-down list. The condition types are:
- Result age is older than (days)
- Branch status is
- Result verdict is one of
- Result size is greater than (MBs)
- Result labels contains one of
- Result labels does NOT contain any of
- The project is one of
- The test type is one of
- Max results per unique test
- Max results per unique test and verdict
Note:You can add multiple conditions to define a retention rule. For example, you can select the condition The project is one of and choose a project. You can add another condition Result verdict is one of and select the value Pass.
The Max results per unique test and Max results per unique test and verdict conditions are not displayed if you selected any of the following conditions:- Result age is older than (days)
- Result verdict is one of
- Result size is greater than (MBs)
The estimated impact is displayed at the bottom of the window, showing how much data will be freed.
- Select one of the following options:
-
Entire Result: Removes all traces of the test result.
-
Just report/testlog: Retains metadata such as verdict and stop reason.
-
- Click Create to add a rule.
Editing retention rule Perform the following steps:
-
Click the Edit icon
next to the rule that you want to
modify.The Edit Rule dialog is displayed.
-
Modify the name in the Rule Name field.
-
Select the conditions from the drop-down list. The conditions types are:
- Result age is older than (days)
- Branch status is
- Result verdict is one of
- Result size is greater than (MBs)
- Result labels contains one of
- Result labels does NOT contain any of
- The project is one of
- The test type is one of
- Max results per unique test
- Max results per unique test and verdict
Note:You can add multiple conditions to define a retention rule. For example, you can select the condition The project is one of and choose a project. You can add another condition Result verdict is one of and select the value Pass.
The Max results per unique test and Max results per unique test and verdict conditions are not available if any of the following conditions are selected:- Result age is older than (days)
- Result verdict is one of
- Result size is greater than (MBs)
The estimated impact is displayed at the bottom of the window, showing how much data will be freed.
-
Select Entire Result to remove all the traces of test result or select Just report/testlog to retain the metadata (For example: verdict, stop reason).
-
Click Update to apply the changes.
Running retention rule Perform the following steps:
-
Click the Execute retention rule now icon
to run the rule immediately to identify
and delete results matching its conditions.The Confirm Recycle dialog is displayed.
-
Click Yes to confirm the action
Deleting retention rule Perform the following steps:
-
Click the Delete Rule icon
to remove the rule from the team space
entirely.The Delete Rule dialog is displayed.
-
Click Delete to confirm the action.
-