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

Why do Test Cases get deleted when a Test Run is deleted?

Hi there,

I just deleted a Test Run, but before I did - I got a message saying that 2,000+ test cases would be ‘irrevocably deleted’ in the process.

This must be because the test run automatically added all test cases at creation as no specific test case collection was specified otherwise.

Anyway, because I paid attention, I cancelled the Delete and changed this selection so that just one test case was associated to the Test Run (I was not allowed to save the test run with no selected test cases - I’m not sure why).

I then went to delete the Test Run again and once again got the test cases will be ‘irrevocably deleted’ warning, but this time went ahead and confirmed the deletion of the Test Run as there was only one associated case this time.

The Test Run has now been successfully deleted - but so has the one test case I had to have associated to it.

My question is why did this test case (or why do all associated Test Cases) get deleted when I deleted the Test Run?

This is an unwanted feature for me and my team. My Test Cases should remain when deleting Test Runs as far as my workflow is concerned.

Can anyone please explain the rational here for these test cases being deleted along with the Test Run?

Thank you

Hi,
is the message really about deleting of test cases?
As far as I remember (no installation available), it is about deleting tests, not test cases. And this is right.

Whenever you create a Test Run you have to associate at least one test case - the client is asking you to do so (can’t remember the API). That’s simply how TestRail is working, probably the dev team doesn’t like to have empty test runs…
The assosicated test case results in a test, which might have multiple results later on.
If you delete the test run, also these tests will be deleted. In fact they still exist in the db, but you can’t reach them anymore because the run can’t be selected anymore and there is no official way to get him back.

For me this is just a hint, informing you about the fact. The test cases won’t be deleted from the related test suite - if there isn’t a bug.

Does the single Test case from the run you have deleted still exists in the suite? I guess yes.

Hope this helps,
Karsten

Thanks Karsten - I had searched the Test Suite for the single Test Case and could not find it - which is why I thought it had been deleted. I will check again at lunch time and confirm - I may have got it wrong - it was the end of a very long day.

Your response is reassuring though - I really appreciate you taking the time to write it out and it all makes sense. Shall report back! Thanks

So my confidence has been restored. This was the message displayed when deleting my test run…

Really delete this test run? This also deletes all tests and results in this run and cannot be undone.
You will irrevocably delete at least  **1**  test and the related test results & comments.
**Yes, delete this test run (cannot be undone)**

There are some very subtle differences in language at play here. I had assumed that:

1. test = test case
and
2. and the related test results and comments = all of the tests run and results in the test run

But actually the second point is just the detail in the test - the way the statement is constructed to me suggested they were two separate things which pushed me into assuming that the test part must refer to test case.

I don’t think anything is wrong here but, in my opinion at least, the language used in this message gives a fair bit of scope for confusion - especially to users who are not fully used to the application like myself, hence me having to come here to clarify.

The good news though is that I have tested this again and the original test case selected in the deleted test run was not removed when the test run was deleted. It remained in the test cases tab.

So I’m happy to report the original issue I reported to be the case is not actually the case. When deleting a test run, the original test cases selected in that test run are NOT deleted - in my experience! I will update the title to reflect this if I can.

Thank for your time Karsten and for clarifying.