Bug 18826 - REST API tests do not clean up
Summary: REST API tests do not clean up
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact:
URL:
Keywords:
: 16977 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-06-19 20:05 UTC by Jonathan Druart
Modified: 2019-06-27 09:24 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 18826: rollback transaction for api tests (3.06 KB, patch)
2017-07-12 20:28 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 18826: rollback transaction for api tests (3.12 KB, patch)
2017-07-20 10:44 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 18826: rollback transaction for api tests (3.16 KB, patch)
2017-07-21 12:09 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18826 - (QA Followup) Add mock SessionStorage to patrons.t (877 bytes, patch)
2017-07-21 12:09 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 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 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. ***