Bug 17633

Summary: Tests should not call set_preference
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: kyle, mtj, tomascohen
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17599
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 17633: Do not call set_preference from tests
[SIGNED-OFF] Bug 17633: Do not call set_preference from tests
Bug 17633: Do not call set_preference from tests
Bug 17633: (QA followup) Remove unneeded warnings
Bug 17633: (QA followup) remove debugging leftover

Description Jonathan Druart 2016-11-15 15:46:00 UTC
If memcached is running, the pref's value will be set in cache.
Comment 1 Jonathan Druart 2016-11-15 16:10:00 UTC
Created attachment 57507 [details] [review]
Bug 17633: Do not call set_preference from tests

If memcached is running, the pref's value will be set in cache, what we
do not want.

t/db_dependent/Context.t and t/db_dependent/sysprefs.t are exceptions
for obvious reasons.

Test plan:
Make sure all these tests still pass
Comment 2 Jonathan Druart 2016-11-15 16:11:23 UTC
Generated with
perl -p -i -e "s/C4::Context->set_preference\((.*),(.*)\);/t::lib::Mocks::mock_preference(\1,\2);/" t/**/*.t
Comment 3 Josef Moravec 2016-11-15 16:21:33 UTC
Created attachment 57508 [details] [review]
[SIGNED-OFF] Bug 17633: Do not call set_preference from tests

If memcached is running, the pref's value will be set in cache, what we
do not want.

t/db_dependent/Context.t and t/db_dependent/sysprefs.t are exceptions
for obvious reasons.

Test plan:
Make sure all these tests still pass

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 4 Tomás Cohen Arazi (tcohen) 2016-11-15 17:09:27 UTC
Created attachment 57509 [details] [review]
Bug 17633: Do not call set_preference from tests

If memcached is running, the pref's value will be set in cache, what we
do not want.

t/db_dependent/Context.t and t/db_dependent/sysprefs.t are exceptions
for obvious reasons.

Test plan:
Make sure all these tests still pass

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 Tomás Cohen Arazi (tcohen) 2016-11-15 17:09:35 UTC
Created attachment 57510 [details] [review]
Bug 17633: (QA followup) Remove unneeded warnings

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 6 Kyle M Hall (khall) 2016-11-16 15:31:22 UTC
Pushed to master for 16.11, thanks Jonathan, Tomas!
Comment 7 Tomás Cohen Arazi (tcohen) 2016-11-16 15:58:39 UTC
Created attachment 57560 [details] [review]
Bug 17633: (QA followup) remove debugging leftover

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 8 Kyle M Hall (khall) 2016-11-16 15:59:19 UTC
Followup pushed to master for 16.11, thanks Tomas!
Comment 9 Mason James 2016-12-14 11:17:46 UTC
Pushed to 16.05.x, for 16.05.06 release