Bug 17633 - Tests should not call set_preference
Summary: Tests should not call set_preference
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-15 15:46 UTC by Jonathan Druart
Modified: 2018-06-04 20:10 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 17633: Do not call set_preference from tests (19.17 KB, patch)
2016-11-15 16:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17633: Do not call set_preference from tests (19.24 KB, patch)
2016-11-15 16:21 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17633: Do not call set_preference from tests (19.28 KB, patch)
2016-11-15 17:09 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 17633: (QA followup) Remove unneeded warnings (4.41 KB, patch)
2016-11-15 17:09 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 17633: (QA followup) remove debugging leftover (997 bytes, patch)
2016-11-16 15:58 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 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 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 2016-11-16 15:31:22 UTC
Pushed to master for 16.11, thanks Jonathan, Tomas!
Comment 7 Tomás Cohen Arazi 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 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