Summary: | t/DateUtils.t causes the build to break (from bug 13601) | ||
---|---|---|---|
Product: | Koha | Reporter: | Robin Sheat <robin> |
Component: | Test Suite | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Galen Charlton <gmcharlt> |
Severity: | blocker | ||
Priority: | P5 - low | CC: | jonathan.druart, katrin.fischer, nicolas.legrand, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13601 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Attachments: |
Bug 13933: Fix t/DateUtils.t without DB
Bug 13933: Fix t/DateUtils.t without DB [PASSED QA] Bug 13933: Fix t/DateUtils.t without DB Reproduce Bug 13933 |
Description
Robin Sheat
2015-03-31 01:16:26 UTC
Created attachment 37400 [details] [review] Bug 13933: Fix t/DateUtils.t without DB If the mysql server is not running, the DateUtils.t tests failed. This is caused by commit dd9f456ab7c2f0e66173a6feb7df2a38604c82cd Bug 13601: Add tests to highlight the problems with DateTime::Format::DateParse The pref dateformat and TimeFormat were retrieved before the mock. Before bug 13601, the complete preference method was mocked, that's why the error did not appear. Test plan: sudo service mysql stop prove t/DateUtils.t should be happy Created attachment 37401 [details] [review] Bug 13933: Fix t/DateUtils.t without DB If the mysql server is not running, the DateUtils.t tests failed. This is caused by commit dd9f456ab7c2f0e66173a6feb7df2a38604c82cd Bug 13601: Add tests to highlight the problems with DateTime::Format::DateParse The pref dateformat and TimeFormat were retrieved before the mock. Before bug 13601, the complete preference method was mocked, that's why the error did not appear. Test plan: sudo service mysql stop prove t/DateUtils.t should be happy Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> Created attachment 37422 [details] [review] [PASSED QA] Bug 13933: Fix t/DateUtils.t without DB If the mysql server is not running, the DateUtils.t tests failed. This is caused by commit dd9f456ab7c2f0e66173a6feb7df2a38604c82cd Bug 13601: Add tests to highlight the problems with DateTime::Format::DateParse The pref dateformat and TimeFormat were retrieved before the mock. Before bug 13601, the complete preference method was mocked, that's why the error did not appear. Test plan: sudo service mysql stop prove t/DateUtils.t should be happy Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Patch pushed to master. Thanks Jonathan! Cheers, I had a quick look but I couldn't actually see _why_ it was happening. Created attachment 37436 [details] Reproduce Bug 13933 This patch create subfields that should break when updating DBRev to 3.19.00.006. Here is the ouptut on a 3.18.x box : $ ./reproduce_bug_13933.pl Add subfield 666z and 666Z Try update to DBRev 3.19.00.006 for marc_subfield_structure only DBD::mysql::db do failed: Duplicate entry '666-z' for key 'PRIMARY' at ./reproduce_bug_13933.pl line 29. Remove subfield 666z and 666Z argh sorry wrong bug, is there a way to remove my attachment and comments? Comment on attachment 37436 [details] Reproduce Bug 13933 Make it obsolete, sorry for the noise :( (In reply to Robin Sheat from comment #5) > Cheers, I had a quick look but I couldn't actually see _why_ it was > happening. It's what I tried to explain in the commit description. Before 13601, the C4::Context->preference method was mocked: for all calls, "us" was returned. The patches for 13601 replaced this global mock with a call to t::lib::Mocks::mock_preference, which mocks only the dateformat pref. But somewhere (dt_from_string if I remember correctly) the value for TimeFormat is retrieved. Since it's not mocked, the value in the DB is picked. You know the rest of the story :) |