[Bug 34152] New: Tests in t/db_dependent/Koha/Item.t fail
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34152 Bug ID: 34152 Summary: Tests in t/db_dependent/Koha/Item.t fail Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: emmi.takkinen@koha-suomi.fi QA Contact: testopia@bugs.koha-community.org Runnins prove t/db_dependent/Koha/Item.t leads to following error: t/db_dependent/Koha/Item.t .. 13/29 # Looks like you planned 15 tests but ran 5. t/db_dependent/Koha/Item.t .. 15/29 # Failed test 'deletion' # at t/db_dependent/Koha/Item.t line 998. Can't call method "can_edit_items_from" on an undefined value at /home/emmi/Koha/Koha/Item.pm line 298. # Looks like your test exited with 255 just after 15. t/db_dependent/Koha/Item.t .. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 15/29 subtests It seems this happens because we don't mock user enviroment for test patron. However after fixing this issue tests still fail: t/db_dependent/Koha/Item.t .. 14/29 encountered object 'Koha::Library=HASH(0x55f674e55708)', but neither allow_blessed, convert_blessed nor allow_tags settings are enabled (or TO_JSON/FREEZE method missing) at /home/emmi/Koha/Koha/BackgroundJob.pm line 107. # Looks like you planned 15 tests but ran 5. # Failed test 'deletion' # at t/db_dependent/Koha/Item.t line 999. Can't call method "biblionumber" on an undefined value at /home/emmi/Koha/t/lib/TestBuilder.pm line 193. # Looks like your test exited with 255 just after 15. t/db_dependent/Koha/Item.t .. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 15/29 subtests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34152 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|chris@bigballofwax.co.nz |emmi.takkinen@koha-suomi.fi --- Comment #1 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 152927 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152927&action=edit Bug 34152: Fix failing t/db_dependent/Koha/Item.t tests This patch fixes following issues in t/db_dependent/Koha/Item.t tests: - "Can't call method "can_edit_items_from" on an undefined value at .../Koha/Item.pm line 298." with sending patron data to mocked environment - "holds tests" test failures due "not_same_branch" errors by mocking IndependentBranches enabled and adding mock user environment To test: 1. Run prove t/db_dependent/Koha/Item.t. => Tests should fail. 2. Apply this patch. 3. Run prove t/db_dependent/Koha/Item.t again. => Success! Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34152 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #2 from Lucas Gass <lucas@bywatersolutions.com> --- Emmi, Is there something extra that has to be done to make these tests fail? I cannot make them fail. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34152 --- Comment #3 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- (In reply to Lucas Gass from comment #2)
Emmi,
Is there something extra that has to be done to make these tests fail? I cannot make them fail.
There shouldn't be. I'm using current master and without this patch, test fail to that "Can't call method "can_edit_items_from" on an undefined value" error. I also checked my database, there shouldn't be anything there causing this (extra constraint etc.). This could be a case of randomly failing tests, but running prove t/db_dependent/Koha/Item.t consistently fails on my environment. So that might not be the reason. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34152 Sam Lau <samalau@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |samalau@gmail.com --- Comment #4 from Sam Lau <samalau@gmail.com> --- Oddly enough, I also can't get it to fail. I ran it 5 times and it passed every time. This is especially weird since tests were failing for me and Lucas on Bug 12133, but it wasn't initially failing for you -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34152 --- Comment #5 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- (In reply to Sam Lau from comment #4)
Oddly enough, I also can't get it to fail. I ran it 5 times and it passed every time. This is especially weird since tests were failing for me and Lucas on Bug 12133, but it wasn't initially failing for you
I actually managed to "can_edit_items_from" problem by changing one of my test borrowers borrowernumber to 51 (which is the borrowernumber of mock patron created with sub mock_userenv). I also had to set him as superlibrarian to prevent "holds tests" from failing. Could it be that sub mock_userenv doesn't work properly? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34152 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #6 from David Nind <david@davidnind.com> --- Like the other earlier comments, the tests pass for me using koha-testing-docker (KTD) before trying to apply the patch. (The patch still applies successfully). I've changed the status to Failed QA - happy to retest if you could identify what settings/changes to make to get it to fail. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34152 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34152 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|Failed QA |RESOLVED --- Comment #7 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Tests no longer fail. Setting status as "RESOLVED INVALID". -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org