Bug 18976 - Fix t/db_dependent/Auth.t cleanup
Summary: Fix t/db_dependent/Auth.t cleanup
Status: Pushed to Stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Lari Taskula
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-24 13:42 UTC by Lari Taskula
Modified: 2017-08-24 14:07 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 18976: Fix t/db_dependent/Auth.t cleanup (1.62 KB, patch)
2017-07-24 13:47 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 18976: (follow-up) Fix t/db_dependent/Search/History.t cleanup (1.43 KB, patch)
2017-07-24 15:20 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 18976: Fix t/db_dependent/Auth.t cleanup (1.70 KB, patch)
2017-07-26 17:38 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18976: (follow-up) Fix t/db_dependent/Search/History.t cleanup (1.51 KB, patch)
2017-07-26 17:38 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18976: [16.11] Add missing use statement (734 bytes, patch)
2017-08-01 11:32 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lari Taskula 2017-07-24 13:42:53 UTC
Test t/db_dependent/Auth.t seems to have an ineffective test data cleanup.
Data generated by TestBuilder is left in borrowers, branches, categories,
sms_providers and sessions tables after the test.

To replicate:
1. Check the row count of borrowers, branches and categories tables
2. prove t/db_dependent/Auth.t
3. Repeat step 1
4. Observe borrowers the following tables have increased in row count:
   - borrowers
   - branches
   - categories
   - sessions
   - sms_providers
Comment 1 Lari Taskula 2017-07-24 13:47:47 UTC
Created attachment 65195 [details] [review]
Bug 18976: Fix t/db_dependent/Auth.t cleanup

Test t/db_dependent/Auth.t seems to have an ineffective test data cleanup.
Data generated by TestBuilder is left in borrowers, branches, categories,
sms_providers and sessions tables after the test.

To replicate:
1. Check the row count of borrowers, branches and categories tables
2. prove t/db_dependent/Auth.t
3. Repeat step 1
4. Observe borrowers the following tables have increased in row count:
   - borrowers
   - branches
   - categories
   - sessions
   - sms_providers

To test:
1. Before applying the patch, go through steps at "To replicate" plan
2. Apply patch
3. Go through steps at "To replicate" plan
4. Observe step 4 no longer applies and those tables have the same number of
   rows as before executing the test.

This issue has been happening in REST tests as well, and this solution is
directly copy-pasted from t/db_dependent/api/v1/cities.t
Comment 2 Lari Taskula 2017-07-24 15:20:30 UTC
Created attachment 65197 [details] [review]
Bug 18976: (follow-up) Fix t/db_dependent/Search/History.t cleanup

Same problem in t/db_dependent/Search/History.t.

To replicate:
1. Check the row count of borrowers, branches, categories, sessions, sms_providers
   tables
2. prove t/db_dependent/Search/History.t
3. Repeat step 1
4. Observe borrowers the following tables have increased in row count:
   - borrowers
   - branches
   - categories
   - sessions
   - sms_providers

To test:
1. Before applying the patch, go through steps at "To replicate" plan
2. Apply patch
3. Go through steps at "To replicate" plan
4. Observe step 4 no longer applies and those tables have the same number of
   rows as before executing the test.
Comment 3 Jonathan Druart 2017-07-26 17:34:40 UTC
Caused by CGI::Session, see bug 17427.
Comment 4 Jonathan Druart 2017-07-26 17:38:07 UTC
Created attachment 65284 [details] [review]
Bug 18976: Fix t/db_dependent/Auth.t cleanup

Test t/db_dependent/Auth.t seems to have an ineffective test data cleanup.
Data generated by TestBuilder is left in borrowers, branches, categories,
sms_providers and sessions tables after the test.

To replicate:
1. Check the row count of borrowers, branches and categories tables
2. prove t/db_dependent/Auth.t
3. Repeat step 1
4. Observe borrowers the following tables have increased in row count:
   - borrowers
   - branches
   - categories
   - sessions
   - sms_providers

To test:
1. Before applying the patch, go through steps at "To replicate" plan
2. Apply patch
3. Go through steps at "To replicate" plan
4. Observe step 4 no longer applies and those tables have the same number of
   rows as before executing the test.

This issue has been happening in REST tests as well, and this solution is
directly copy-pasted from t/db_dependent/api/v1/cities.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Jonathan Druart 2017-07-26 17:38:11 UTC
Created attachment 65285 [details] [review]
Bug 18976: (follow-up) Fix t/db_dependent/Search/History.t cleanup

Same problem in t/db_dependent/Search/History.t.

To replicate:
1. Check the row count of borrowers, branches, categories, sessions, sms_providers
   tables
2. prove t/db_dependent/Search/History.t
3. Repeat step 1
4. Observe borrowers the following tables have increased in row count:
   - borrowers
   - branches
   - categories
   - sessions
   - sms_providers

To test:
1. Before applying the patch, go through steps at "To replicate" plan
2. Apply patch
3. Go through steps at "To replicate" plan
4. Observe step 4 no longer applies and those tables have the same number of
   rows as before executing the test.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Jonathan Druart 2017-07-26 17:38:48 UTC
Skipping QA, it will fixes selenium tests.
Comment 7 Jonathan Druart 2017-07-26 17:39:46 UTC
Pushed to master for 17.11, thanks Lari!
Comment 8 Fridolin SOMERS 2017-07-31 07:25:37 UTC
Pushed to 17.05.x, will be in 17.05.03.

In order to correct selenium test failures.
Comment 9 Katrin Fischer 2017-08-01 05:39:45 UTC
Patches apply, but don't work on 16.11.x:

kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ perl t/db_dependent/Search/History.t 
1..26
Undefined subroutine &t::lib::Mocks::mock_preference called at t/db_dependent/Search/History.t line 19.
# Looks like your test exited with 255 before it could output anything.
Comment 10 Jonathan Druart 2017-08-01 11:32:06 UTC
Created attachment 65390 [details] [review]
Bug 18976: [16.11] Add missing use statement

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Katrin Fischer 2017-08-16 21:55:23 UTC
All good this time - thx for the follow-up!

These patches have been pushed to 16.11.x and will be in 16.11.11.
Comment 12 Mason James 2017-08-24 14:07:16 UTC
Pushed to 16.05.x, for 16.05.16 release