[Bug 26984] New: Tests are failing if AnonymousPatron is configured
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Bug ID: 26984 Summary: Tests are failing if AnonymousPatron is configured Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org After bug 14708 we are blocking the removal of the anonymous patron. In some tests we are deleting data, like patrons, and the tests fail with "Deleting patron failed, AnonymousPatron is not deleteable" One example is t/db_dependent/Koha/Item.t # Failed test 'No tests run for subtest "pickup_locations"' # at t/db_dependent/Koha/Item.t line 340. [Deleting patron failed, AnonymousPatron is not deleteable]# Looks like your test exited with 255 just after 4. We must not remove data before the tests are run. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_20_11_target -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |14708 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14708 [Bug 14708] The patron set as the anonymous patron should not be deletable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 113547 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113547&action=edit Bug 26984: Don't delete data in Koha/Item.t tests I don't really understand why I had to lower the number of tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 113550 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113550&action=edit Bug 26984: Make other tests pass if AnonymousPatron is set There is only 1 place where it can be tricky to not remove them as we want exactly 10 patrons to be present in the DB -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|chris@bigballofwax.co.nz |jonathan.druart@bugs.koha-c | |ommunity.org Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113547|0 |1 is obsolete| | Attachment #113550|0 |1 is obsolete| | --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 113551 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113551&action=edit Bug 26984: Don't delete data in Koha/Item.t tests I don't really understand why I had to lower the number of tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 --- Comment #4 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 113552 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113552&action=edit Bug 26984: Make other tests pass if AnonymousPatron is set There is only 1 place where it can be tricky to not remove them as we want exactly 10 patrons to be present in the DB Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com --- Comment #5 from Nick Clemens <nick@bywatersolutions.com> --- The first patch here is similar to bug 26963 - please consider that patch as it solves other issues as well -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113551|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Nick Clemens from comment #5)
The first patch here is similar to bug 26963 - please consider that patch as it solves other issues as well
I obsoleted it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113552|0 |1 is obsolete| | --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 113662 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113662&action=edit Bug 26984: Make tests pass if AnonymousPatron is set There is only 1 place where it can be tricky to not remove them as we want exactly 10 patrons to be present in the DB Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I expected this patch to touch t::lib::TestBuilder. Am I missing something? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Tomás Cohen Arazi from comment #8)
I expected this patch to touch t::lib::TestBuilder. Am I missing something?
I don't understand, can you explain? If the AnonymousPatron syspref is defined BEFORE you run the tests, then the deletion will fail. We need to adjust the tests to not remove the existing patrons we have in DB. This is an assumption we should keep in mind for all tests and all data (there are few exceptions however). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #9)
(In reply to Tomás Cohen Arazi from comment #8)
I expected this patch to touch t::lib::TestBuilder. Am I missing something?
I don't understand, can you explain?
If the AnonymousPatron syspref is defined BEFORE you run the tests, then the deletion will fail. We need to adjust the tests to not remove the existing patrons we have in DB. This is an assumption we should keep in mind for all tests and all data (there are few exceptions however).
To make sure that by default we don't generate an anonymous user. I agree we shouldn't delete all, generally. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- We won't generate an anonymous user, unless weird case (you have the pref set but the AI for borrowers is not there yet...) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 --- Comment #12 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 113704 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113704&action=edit Bug 26984: (follow-up) Don't delete patrons and checkouts in Objects.t Rather than counting all and assuriing we get 10, we can count all, add 10, and ensure the numbers still match -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Nick Clemens from comment #12)
Created attachment 113704 [details] [review] Bug 26984: (follow-up) Don't delete patrons and checkouts in Objects.t
Rather than counting all and assuriing we get 10, we can count all, add 10, and ensure the numbers still match
We want 10 and only 10 patrons, we don't want pagination: my $patrons = Koha::Patrons->search(); is( $patrons->count, 10, 'Search returns all patrons' ); ok( !$patrons->is_paged, 'Search is not paged' ); I haven't tried, but I am expecting your patch to make the tests fail if there are existing patrons in the DB. Don't they? If so the test is buggy I'd say... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 --- Comment #14 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #13)
(In reply to Nick Clemens from comment #12)
Created attachment 113704 [details] [review] [review] Bug 26984: (follow-up) Don't delete patrons and checkouts in Objects.t
Rather than counting all and assuriing we get 10, we can count all, add 10, and ensure the numbers still match
We want 10 and only 10 patrons, we don't want pagination:
my $patrons = Koha::Patrons->search(); is( $patrons->count, 10, 'Search returns all patrons' ); ok( !$patrons->is_paged, 'Search is not paged' );
I haven't tried, but I am expecting your patch to make the tests fail if there are existing patrons in the DB. Don't they? If so the test is buggy I'd say...
As I understand, the resultset shouldn't be paged unless we asked for it to be paged, I don't believe it happens automatically: https://metacpan.org/pod/DBIx::Class::ResultSet#page https://metacpan.org/pod/DBIx::Class::ResultSet#is_paged I don't believe we have any reason to need strictly 10 patrons -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Yes, you are right, Nick. I misread the test. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 --- Comment #16 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #11)
We won't generate an anonymous user, unless weird case (you have the pref set but the AI for borrowers is not there yet...)
We'll see :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Version|unspecified |master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113704|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113662|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 --- Comment #17 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 113817 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113817&action=edit Bug 26984: Make tests pass if AnonymousPatron is set There is only 1 place where it can be tricky to not remove them as we want exactly 10 patrons to be present in the DB Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 --- Comment #18 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 113818 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113818&action=edit Bug 26984: (follow-up) Don't delete patrons and checkouts in Objects.t Rather than counting all and assuriing we get 10, we can count all, add 10, and ensure the numbers still match Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |20.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 --- Comment #19 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 20.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |27062 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27062 [Bug 27062] pickup_location tests don't deal correctly with existing libraries -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_20_11_target | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|20.11.00 |20.11.00, 20.05.07 released in| | CC| |andrew@bywatersolutions.com Status|Pushed to master |Pushed to stable --- Comment #20 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Pushed to 20.05.x for 20.05.07 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Bug 26984 depends on bug 14708, which changed state. Bug 14708 Summary: The patron set as the anonymous patron should not be deletable https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14708 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net --- Comment #21 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Missing dependencies for 19.11.x, can't backport. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26984 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to oldstable |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org