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

Delete completed runs


#1

Is there a way to (or add a way) delete completed test runs?


#2

Hello Mike,

Deleting completed test runs is currently not supported. This is by design actually so that completed runs are archived and can be used for auditing purposes. Completed runs are also immutable which means that changes to the referenced test cases or test suite do not propagate to the completed/closed test run (e.g. if you delete a test case in the test suite of the run, the related test and its test results are still available for a completed test run).

Regards,
Tobias


#3

Hello again,

I forgot to mention that we also already have a feature request for this and we are considering offering this as an option. For example, this could be a special permission that could be added or removed from roles/users.

Thanks,
Tobias


#4

I think it’s great that the completed Test Runs retain all the original test cases and data (even if it was later deleted).

I agree that it would be nice if Administrators had access to delete completed Test Runs. I would use that feature as I sometimes create dummy runs for testing purposes and don’t want them mixed in with my real data.


#5

Hello,

Thanks for the feedback. Yes, we will consider allowing administrators to delete closed test runs in the future, although this would likely not be enabled by default. Regarding “dummy” test runs: you can delete test runs (by editing the run and clicking the Delete link in the sidebar), but you shouldn’t close it before doing so.

Thanks,
Dennis


#6

Can you explain how we should proceed if we want to remove a completed run from testrail ?

I mean, if it must be done directly in the database, why not but I really need to delete it.

Thanks in advance,


#7

Hello Louis,

which version of TestRail do you use? If it’s a single test run (not a test plan), you would basically need to manually delete the entry in the ‘runs’ table in the database and also the corresponding entries in the ‘tests’ and ‘test_changes’ tables. I can let you know the exact steps once I know your TestRail version. By the way, I strongly recommend making a fresh backup of your database before making any manual changes to the database and executing custom queries.

Regards,
Tobias


#8

[quote=tgurock]Hello Louis,

which version of TestRail do you use? If it’s a single test run (not a test plan), you would basically need to manually delete the entry in the ‘runs’ table in the database and also the corresponding entries in the ‘tests’ and ‘test_changes’ tables. I can let you know the exact steps once I know your TestRail version. By the way, I strongly recommend making a fresh backup of your database before making any manual changes to the database and executing custom queries.

Regards,
Tobias[/quote]

I use the latest version (2.3.1.871) and I need to delete a test plan containing 4 runs.

Thanks,

Louis


#9

Thanks for the additional information. To delete a (completed) test plan, you would first need to find out the database IDs of the associated test runs. You could do this in TestRail itself (the ID is part of the URL when you view a test run, e.g. http://server/index.php?/runs/view/1 would refer to the run with the ID 1), or via the database.

We use a database query to find out the IDs. Test plans are stored in the same table as test runs. In this example, I assume the test plan has ID 100:

This returns the IDs of the associated test runs. Let’s assume the query returned the IDs 101, 102 and 103. We can then delete the associated tests, test results and the runs with the following queries:

The final step would be to delete the test plan itself:

Again, please make sure to make a backup before executing these or similar queries. The data cannot be restored if you accidentally delete the wrong data.

Regards,
Tobias


#10

Thanks for the information. I’ll look at it and do as you suggested (backuping first :)).


#11

Hi,

Are there any news regarding this issue? We’re using testrail and would also like administrators to have the option of deleting completed runs.
The idea of archiving test runs is important but after a while of using will create a really long list of test runs…
It would have been really comfortable if there was a way to either delete the completed test runs (admins only of-course) or to move to to completed runs list (separated from the open runs, and/or have a remove to completed list button or such)

Thanks


#12

Hello Hod,

Thanks for your posting. We don’t have an update for this feature request at this point, but it’s still on our list of things to look into. That said, you can already close completed test runs (via the lock icon when viewing a test runs) which archives them (makes them read-only) and moves them to a Completed list on the test run overview.

I hope this helps and please let me know in case you have any further questions.

Regards,
Tobias


#13

As far as I can tell this feature is still not available and would be something we would be greatly interested in.


#14

Good news, we actually added the ability to delete closed test runs/plans recently with our TestRail 4.2 release! Here are the details:

http://blog.gurock.com/?p=3193

We also added a new permission for this and it’s deactivated by default, that’s why you likely don’t see this option yet. We would usually recommend creating a new role for a few select users who should be able to delete closed runs under Administration > Users & Roles.


#15

Thanks! good feature for when doing demos of testrail internally and we need to cleanup afterward!


#16

Regarding dummy runs, those could be placed in a project specifically for dummy runs.


#17

Hi Alex,

Thanks for your reply! Yes, you could use a separate project for testing if needed, and can also delete any test project later if no longer needed. You can also delete specific closed test runs within a project by enabling the permission under Administration > Users & Roles (although we always recommend disabling this permission again after deleting what you need to prevent accidental deletions in the future). Hope this helps!

Regards,
Marco