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

Test runs in a test plan get deleted/re-created (bug)


#1

Hello,
We’re using the extended mini api to create a new test plan and mass add about a 150 test suites to it. Using this call:

curl -d "name=TestPlanA" -d "milestone_id=2" -d "suite_ids=1,2,3,4,5,6,7,8,9,10,..." "http://<URL>/index.php?/miniapi/add_plan/1&key=<KEY>"

It completes successfully and I can confirm it in the UI if I open “TestPlanA” and verify the 150 runs in it.

However, if one edits the test plan, makes changes (or not) and then clicks the “Save Test Plan”, a popup box informs the user that ALL the test runs are being deleted and re-added. Click Ok. Notice that all the test runs within this test plan have been deleted and recreated (you can see the id has changed).

If by chance, some of those runs have had test results reported against them, they’re deleted as well.

It seems that only the first edit/save action triggers this behavior, pointing to the mini api being the culprit. Somehow, the way it inserts test plans into the DB differs from they way the GUI does it.

A workaround for us, is to create the test plan, do a no-op edit/save, watch it harmlessly delete/recreate the test runs. Once this first action is done, further edit/save operations seem fine.

Could you confirm if this is a bug in the mini extended api ?
We’re using mini api version 1.4 with TestRail 2.2.0.426.

thanks,

-Rami


#2

Hello Rami,

This indeed looks like a bug in the API. We will take a look at the relevant methods and send you an updated version of the API today/tomorrow.

Thanks,
Tobias


#3

Hello,

Just to update this thread: we’ve send and provided an updated API version with the fix. If anyone else is experiencing this issue, please email us to receive the updated API version.

Thanks,
Dennis