Summary: | Tests in t/db_dependent/Koha/Item.t fail | ||
---|---|---|---|
Product: | Koha | Reporter: | Emmi Takkinen <emmi.takkinen> |
Component: | Test Suite | Assignee: | Emmi Takkinen <emmi.takkinen> |
Status: | CLOSED INVALID | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | david, lucas, samalau |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Attachments: | Bug 34152: Fix failing t/db_dependent/Koha/Item.t tests |
Description
Emmi Takkinen
2023-06-29 11:44:27 UTC
Created attachment 152927 [details] [review] 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 Emmi, Is there something extra that has to be done to make these tests fail? I cannot make them fail. (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. 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 (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? 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. Tests no longer fail. Setting status as "RESOLVED INVALID". |