Bug 18942

Summary: CanUserUseBudget.t and CanUserModifyBudget.t missing system user test cases
Product: Koha Reporter: Lee Jamison <ldjamison>
Component: AcquisitionsAssignee: Mark Tompsett <mtompset>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, mtompset, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 17829    
Bug Blocks:    
Attachments: Bug 18942: Add test case to prove change
Bug 18942: Internal Server Error symptomatic of using system user
Bug 18942: Add test case to prove change
Bug 18942: Internal Server Error symptomatic of using system user
Bug 18942: Simplify syntax
Bug 18942: Add test case to prove change
Bug 18942: Internal Server Error symptomatic of using system user
Bug 18942: Simplify syntax
Bug 18942: (QA followup) Add new tests descriptions

Description Lee Jamison 2017-07-14 14:10:07 UTC
Under certain circumstances, the Acquisitions module fails to load at CanUserUseBudget in C4::Budgets.

To replicate (assuming using kohadevbox):
1. Login as koha_kohadev
2. Attempt to load the Acquisitions module
3. Notice Internal Server Error
4. Check plack log which shows Can't call method "unblessed" on an undefined value at /home/vagrant/kohaclone/C4/Budgets.pm line 919.
Comment 1 Mark Tompsett 2017-07-14 14:38:31 UTC
Given there is an easy way to trigger this problem. I changed the title.
Comment 2 Mark Tompsett 2017-07-14 14:38:59 UTC
-- and expanded scope a little: same file, same tweak.
Comment 3 Mark Tompsett 2017-07-14 14:50:04 UTC
Created attachment 65051 [details] [review]
Bug 18942: Add test case to prove change
Comment 4 Mark Tompsett 2017-07-14 14:50:07 UTC
Created attachment 65052 [details] [review]
Bug 18942: Internal Server Error symptomatic of using system user

TEST PLAN
---------
1) sudo koha-shell -c bash kohadev
2) prove -v t/Budgets/CanUserUseBudget.t
   -- works
3) prove -v t/Budgets/CanUserModifyBudget.t
   -- works
4) exit
5) git bz apply 18942
   -- interactive just the test patch
6) repeat steps 1-4
   -- prove fails (similar message with 919 in comment #0)
7) git bz apply 18942
   -- interactive just the actual fix
8) repeat steps 1-4
   -- works
9) run koha qa test tools
Comment 5 Lee Jamison 2017-07-14 15:15:07 UTC
Created attachment 65055 [details] [review]
Bug 18942: Add test case to prove change

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Works as directed following test plan!
Comment 6 Lee Jamison 2017-07-14 15:15:16 UTC
Created attachment 65056 [details] [review]
Bug 18942: Internal Server Error symptomatic of using system user

TEST PLAN
---------
1) sudo koha-shell -c bash kohadev
2) prove -v t/Budgets/CanUserUseBudget.t
   -- works
3) prove -v t/Budgets/CanUserModifyBudget.t
   -- works
4) exit
5) git bz apply 18942
   -- interactive just the test patch
6) repeat steps 1-4
   -- prove fails (similar message with 919 in comment #0)
7) git bz apply 18942
   -- interactive just the actual fix
8) repeat steps 1-4
   -- works
9) run koha qa test tools

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Comment 7 Jonathan Druart 2017-07-17 16:47:02 UTC
Login with DB user is not allowed, the only 2 available actions are 1. Create a patron and 2. Set the superlibrarian permission
Comment 8 Jonathan Druart 2017-07-17 16:48:41 UTC
Created attachment 65078 [details] [review]
Bug 18942: Simplify syntax
Comment 9 Tomás Cohen Arazi (tcohen) 2017-07-17 17:49:59 UTC
Created attachment 65079 [details] [review]
Bug 18942: Add test case to prove change

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 10 Tomás Cohen Arazi (tcohen) 2017-07-17 17:50:05 UTC
Created attachment 65080 [details] [review]
Bug 18942: Internal Server Error symptomatic of using system user

TEST PLAN
---------
1) sudo koha-shell -c bash kohadev
2) prove -v t/Budgets/CanUserUseBudget.t
   -- works
3) prove -v t/Budgets/CanUserModifyBudget.t
   -- works
4) exit
5) git bz apply 18942
   -- interactive just the test patch
6) repeat steps 1-4
   -- prove fails (similar message with 919 in comment #0)
7) git bz apply 18942
   -- interactive just the actual fix
8) repeat steps 1-4
   -- works
9) run koha qa test tools

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 11 Tomás Cohen Arazi (tcohen) 2017-07-17 17:50:10 UTC
Created attachment 65081 [details] [review]
Bug 18942: Simplify syntax

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 12 Tomás Cohen Arazi (tcohen) 2017-07-17 17:50:18 UTC
Created attachment 65082 [details] [review]
Bug 18942: (QA followup) Add new tests descriptions

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 13 Jonathan Druart 2017-07-17 19:13:46 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 14 Fridolin Somers 2017-07-27 14:50:22 UTC
Not pushed to 17.05.x because depends on Bug 17829