Bug 22860 - Selenium tests authentication.t does not remove all data it created
Summary: Selenium tests authentication.t does not remove all data it created
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 19181
Blocks:
  Show dependency treegraph
 
Reported: 2019-05-06 20:37 UTC by Jonathan Druart
Modified: 2020-11-30 21:47 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:
20.05.00, 19.11.04, 19.05.09


Attachments
Bug 22860: Remove 1 remaining patron after authentication.t is ran (1.20 KB, patch)
2019-05-06 20:39 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 22860: Remove 1 remaining patron after authentication.t is ran (1.26 KB, patch)
2020-01-23 03:37 UTC, Hayley Pelham
Details | Diff | Splinter Review
Bug 22860: Remove 1 remaining patron after authentication.t is ran (1.32 KB, patch)
2020-02-09 10:55 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2019-05-06 20:37:35 UTC
1 patron will remain in the DB after the tests ran.
Comment 1 Jonathan Druart 2019-05-06 20:39:27 UTC
Created attachment 89400 [details] [review]
Bug 22860: Remove 1 remaining patron after authentication.t is ran

Test plan:
0/ Do not apply the patch
1/ select count(*) from borrowers;
2/ Run the tests
=> Notice that you have 1 more patron
3/ Apply the patch and repeat 1/ and 2/
=> Notice that you have the same number of patrons before and after the
tests
Comment 2 Hayley Pelham 2019-05-07 02:20:32 UTC
I tried to test this, but was unable to replicate on master.

Borrower count was 2, I ran prove t/db_dependent/selenium/authentication.t, then checked my borrower count again, and it was two. Have I missed a step here?
Comment 3 Jonathan Druart 2019-05-07 14:45:42 UTC
Can you try that:


kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ git fetch origin
kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ git checkout -B master origin/master
kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ koha-mysql kohadev -e "select count(*) from borrowers;"                                                                                                           
+----------+
| count(*) |
+----------+
|       99 |
+----------+
kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ prove t/db_dependent/selenium/authentication.t
t/db_dependent/selenium/authentication.t .. ok 
All tests successful.
Files=1, Tests=2, 24 wallclock secs ( 0.02 usr  0.02 sys +  2.07 cusr  0.76 csys =  2.87 CPU)
Result: PASS
kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ koha-mysql kohadev -e "select count(*) from borrowers;"
+----------+
| count(*) |
+----------+
|      100 |
+----------+

The selenium server must have been started before (in a devbox you can use the `start_selenium` alias)
Comment 4 Hayley Pelham 2020-01-23 03:37:52 UTC
Created attachment 97771 [details] [review]
Bug 22860: Remove 1 remaining patron after authentication.t is ran

Test plan:
0/ Do not apply the patch
1/ select count(*) from borrowers;
2/ Run the tests
=> Notice that you have 1 more patron
3/ Apply the patch and repeat 1/ and 2/
=> Notice that you have the same number of patrons before and after the
tests

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Comment 5 Bouzid Fergani 2020-02-07 19:57:11 UTC
Hi, 
I can't reproduce this issue in the updated master

mysql> select count(*) from borrowers;
+----------+
| count(*) |
+----------+
|    68379 |
+----------+

prove t/db_dependent/selenium/authentication.t
t/db_dependent/selenium/authentication.t .. ok   
All tests successful.
Files=1, Tests=2,  1 wallclock secs ( 0.02 usr  0.00 sys +  1.68 cusr  0.11 csys =  1.81 CPU)
Result: PASS

mysql> select count(*) from borrowers;
+----------+
| count(*) |
+----------+
|    68379 |
+----------+

You can check this please.
Thanks.
Bouzid.
Comment 6 Katrin Fischer 2020-02-09 10:52:39 UTC
I can replicate the issue on master - trying the fix next.
Comment 7 Katrin Fischer 2020-02-09 10:55:21 UTC
Created attachment 98615 [details] [review]
Bug 22860: Remove 1 remaining patron after authentication.t is ran

Test plan:
0/ Do not apply the patch
1/ select count(*) from borrowers;
2/ Run the tests
=> Notice that you have 1 more patron
3/ Apply the patch and repeat 1/ and 2/
=> Notice that you have the same number of patrons before and after the
tests

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Martin Renvoize 2020-02-10 09:23:26 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 9 Joy Nelson 2020-03-05 00:39:18 UTC
Pushed to 19.11.x branch for 19.11.04
Comment 10 Lucas Gass 2020-03-09 19:30:32 UTC
backported to 19.05.x for 19.05.09