| 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, nicolas.legrand, tomascohen |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: | http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13601 | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | --- |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
| 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 |
||
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 :) |
DBI connect('dbname=koha;host=localhost;port=3306','kohaadmin',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /usr/share/perl5/DBIx/Connector.pm line 32 Can't call method "do" on unblessed reference at /tmp/buildd/koha-3.19~git+20150331135711.7fa67b2f/blib/PERL_MODULE_DIR/C4/Context.pm line 817. # Looks like you planned 55 tests but ran 4. # Looks like your test exited with 255 just after 4. t/DateUtils.t ....................... This is caused by: commit dd9f456ab7c2f0e66173a6feb7df2a38604c82cd Author: Jonathan Druart <jonathan.druart@biblibre.com> Date: Tue Jan 20 15:28:19 2015 +0100 Bug 13601: Add tests to highlight the problems with DateTime::Format::DateParse