Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

Delete closed test plan/run and associated case


We have run into an issue where we have millions of test runs and results which have been closed. It is my understanding that closing a test plan makes a copy of the associated test case so that you have reference to the case details at the time the test was executed.

We have now run out of space and need to delete these closed test plans. We run a script which calls the delete_plan api. It appears that this deletes the plan and test results from the tests table, however the cases table is untouched. Is that correct? How can we also delete the copied test case that was created as a result of closing the test plan?



Hi Holly,

Thanks for your posting! Deleting a closed plan/run will also delete the internal case copies and remove those rows from the cases table. Please note that deleting data from databases will not necessarily lower the amount of disk space they need and databases would normally just mark those blocks as deleted and not physically remove them (for optimization reasons). The number of rows in the cases table, however, would be reduced and this is also beneficial performance-wise.