Bug 18826

Summary: REST API tests do not clean up
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: REST APIAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P5 - low CC: fridolin.somers, lari.taskula, ldjamison, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 18826: rollback transaction for api tests
[SIGNED-OFF] Bug 18826: rollback transaction for api tests
Bug 18826: rollback transaction for api tests
Bug 18826 - (QA Followup) Add mock SessionStorage to patrons.t

Description Jonathan Druart 2017-06-19 20:05:44 UTC
prove -r t/db_dependent/api/v1
will modify DB data, they should not
Comment 1 Jonathan Druart 2017-07-12 20:28:06 UTC
Created attachment 65012 [details] [review]
Bug 18826: rollback transaction for api tests

The holds.t tests for the REST api do no rollback properly and modify
the DB (no cleanup).
This comes from a bug caused by SessionStorage = mysql (default)

The error is:
    "rollback ineffective with AutoCommit enabled"

Test plan:
  select count(*) from borrowers;
  prove t/db_dependent/api/v1/holds.t
  select count(*) from borrowers;
=> The number of entry must be the same before and after the tests have
been executed
Comment 2 Josef Moravec 2017-07-20 10:44:36 UTC
Created attachment 65143 [details] [review]
[SIGNED-OFF] Bug 18826: rollback transaction for api tests

The holds.t tests for the REST api do no rollback properly and modify
the DB (no cleanup).
This comes from a bug caused by SessionStorage = mysql (default)

The error is:
    "rollback ineffective with AutoCommit enabled"

Test plan:
  select count(*) from borrowers;
  prove t/db_dependent/api/v1/holds.t
  select count(*) from borrowers;
=> The number of entry must be the same before and after the tests have
been executed

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 3 Nick Clemens (kidclamp) 2017-07-21 12:09:23 UTC
Created attachment 65177 [details] [review]
Bug 18826: rollback transaction for api tests

The holds.t tests for the REST api do no rollback properly and modify
the DB (no cleanup).
This comes from a bug caused by SessionStorage = mysql (default)

The error is:
    "rollback ineffective with AutoCommit enabled"

Test plan:
  select count(*) from borrowers;
  prove t/db_dependent/api/v1/holds.t
  select count(*) from borrowers;
=> The number of entry must be the same before and after the tests have
been executed

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 4 Nick Clemens (kidclamp) 2017-07-21 12:09:25 UTC
Created attachment 65178 [details] [review]
Bug 18826 - (QA Followup) Add mock SessionStorage to patrons.t
Comment 5 Jonathan Druart 2017-07-24 19:04:07 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 6 Fridolin Somers 2017-07-27 10:07:30 UTC
Pushed to 17.05.x, will be in 17.05.02.
Comment 7 Katrin Fischer 2017-07-27 23:18:39 UTC
These patches have been pushed to 16.11.x and will be in 16.11.10.
Comment 8 Jonathan Druart 2017-08-30 14:25:34 UTC
*** Bug 16977 has been marked as a duplicate of this bug. ***