[Bug 17770] New: t/db_dependent/ Sitemapper.t fails when date changes during test run
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 Bug ID: 17770 Summary: t/db_dependent/Sitemapper.t fails when date changes during test run Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: katrin.fischer@bsz-bw.de QA Contact: gmcharlt@gmail.com (22:48:28) tcohen: we need to fix the test (22:48:34) tcohen: so it mocks the current date t_db_dependent_Sitemapper_t.Its content is valid (369) Failing for the past 1 build (Since Unstable#6 ) Took 0 ms. Error Message not ok 12 - Its content is valid Standard Output 1..16 ok 1 - use Koha::Sitemapper; ok 2 - use Koha::Sitemapper::Writer; ok 3 - add fixtures ok 4 - File sitemapindex.xml created ok 5 - Its content is valid ok 6 - File sitemap0001.xml created ok 7 - Its content is valid ok 8 - File sitemap0001.xml with short URLs created ok 9 - Its content is valid ok 10 - add fixtures ok 11 - File sitemapindex.xml for 75000 bibs created not ok 12 - Its content is valid ok 13 - File sitemap0001.xml created ok 14 - It contains 50000 URLs ok 15 - File sitemap0002.xml created ok 16 - It contains 25000 URLs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 --- Comment #1 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 68994 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68994&action=edit Bug 17770: Sitemapper.t fails if date changes during test run To compensate, DateTime->now is mocked to the current date. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 --- Comment #2 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 68995 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68995&action=edit Bug 17770: Improve perlcritic level before patch: perlcritic -4 noisy after patch: perlcritic -4 ok -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 --- Comment #3 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 68996 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68996&action=edit Bug 17770: Perltidy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtompset@hotmail.com Assignee|chris@bigballofwax.co.nz |mtompset@hotmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 Jon Knight <J.P.Knight@lboro.ac.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 --- Comment #4 from Jon Knight <J.P.Knight@lboro.ac.uk> --- Created attachment 69741 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69741&action=edit [SIGNED-OFF] Bug 17770: Sitemapper.t fails if date changes during test run To compensate, DateTime->now is mocked to the current date. Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 --- Comment #5 from Jon Knight <J.P.Knight@lboro.ac.uk> --- Created attachment 69742 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69742&action=edit [SIGNED-OFF] [SIGNED-OFF] Bug 17770: Improve perlcritic level before patch: perlcritic -4 noisy after patch: perlcritic -4 ok Signed-off-by: Your Full Name <your_email> Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 --- Comment #6 from Jon Knight <J.P.Knight@lboro.ac.uk> --- Created attachment 69743 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69743&action=edit [SIGNED-OFF] [SIGNED-OFF] Bug 17770: Perltidy Signed-off-by: Your Full Name <your_email> Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 Jon Knight <J.P.Knight@lboro.ac.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |J.P.Knight@lboro.ac.uk --- Comment #7 from Jon Knight <J.P.Knight@lboro.ac.uk> --- Hmm, I removed the duff "Signed-off-by: Your Full Name <your_email>" in all three patches I thought... that was just signed off by me. Incidentally I checked this by running the given test repeatedly whilst changing the date on the machine wildly - all tests completed successfully. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #68994|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #68995|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #68996|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 --- Comment #8 from M. Tompsett <mtompset@hotmail.com> --- The Your Name sign offs are usually a result of failing to set the git setting up: https://wiki.koha-community.org/wiki/Git_bz_configuration https://wiki.koha-community.org/wiki/Koha_on_ubuntu_-_git#Download_the_lates... (Some of the things overlap, some don't. That's why I put both) Also, you'll notice your signed off versions have [SIGNED-OFF] in the title. That means you have to pay attention to which things you need to obsolete when attaching, because different title means different patch. I've obsoleted the non-signed versions. Thanks for the sign off, Jon Knight. :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- You are mocking now while there is only one call left. Why not just call DateTime->now only once to fill $now ? First getting the complete date and then extracting ymd later is unneeded? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 --- Comment #10 from M. Tompsett <mtompset@hotmail.com> --- (In reply to Marcel de Rooy from comment #9)
You are mocking now while there is only one call left. Why not just call DateTime->now only once to fill $now ? First getting the complete date and then extracting ymd later is unneeded?
Yes, only 85 directly uses it. However, there are tests on lines 71, 83, 97, 100, 116, 129, 145, 154, 164, 182, 185, 193, 196, and 204. Any of these that trigger DateTime->now()->ymd on line 109 of Koha::SiteMapper::Writer needs the mock. Otherwise the end tag won't match. I added a nice print STDERR "TRIGGERED!\n"; just about it and determined that the tests 4, 8, and 11 use it. This means this mock will fix not just test 12's more typical failure, but even the rarest cases of 5 and 9. Plus, I was implementing exactly what was suggested in comment #0 by Katrin Fischer. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- More Tomas, I just filed it :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Status|Signed Off |Failed QA --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I guess you are looking for Time::Fake here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #13 from M. Tompsett <mtompset@hotmail.com> --- (In reply to Jonathan Druart from comment #12)
I guess you are looking for Time::Fake here.
No, when the server lags, the time expected doesn't match the time generated. We need a mock, not a Time::Fake. Time::Fake does relative shifts in time. This is a matter of holding time still. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Sorry, I did not get the problem. Actually we have a lot of tests that would fail if run at midnight. I would suggest to sleep at that time and run the test suite in the next morning. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 --- Comment #15 from M. Tompsett <mtompset@hotmail.com> --- (In reply to Jonathan Druart from comment #14)
Actually we have a lot of tests that would fail if run at midnight. I would suggest to sleep at that time and run the test suite in the next morning.
Counter-patch coming... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69741|0 |1 is obsolete| | --- Comment #16 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 69929 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69929&action=edit Bug 17770: Counter patch - sleep till past midnight. As per Jonathan's comment #14, added a wait_till_midnight function to t::lib::Dates. Running this test at 23:59 will trigger a sleep until after midnight accumulated in 60 second intervals. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69742|0 |1 is obsolete| | --- Comment #17 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 69930 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69930&action=edit Bug 17770: Perlcritic improvements before patch: perlcritic -3 noisy after patch: perlcritic -3 ok -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69743|0 |1 is obsolete| | --- Comment #18 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 69931 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69931&action=edit Bug 17770: Perltidy differences should only be whitespace -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff --- Comment #19 from M. Tompsett <mtompset@hotmail.com> --- Here is the sleep only version that even provides a nice sleep function for other tests which may need it too. As per Jonathan's comment #14 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 --- Comment #20 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to M. Tompsett from comment #19)
Here is the sleep only version that even provides a nice sleep function for other tests which may need it too. As per Jonathan's comment #14
Well, it meant to be taken as a second degree joke :) Maybe I forgot a smiley... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69741|1 |0 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69742|1 |0 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69743|1 |0 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69929|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69930|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69931|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #21 from M. Tompsett <mtompset@hotmail.com> --- Restored older version since Jonathan suggested the sleep was a joke in comment #20. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com QA Contact|gmcharlt@gmail.com |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69741|0 |1 is obsolete| | Attachment #69742|0 |1 is obsolete| | Attachment #69743|0 |1 is obsolete| | --- Comment #22 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 70005 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70005&action=edit Bug 17770: Sitemapper.t fails if date changes during test run To compensate, DateTime->now is mocked to the current date. Signed-off-by: Your Full Name <your_email> Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 --- Comment #23 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 70006 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70006&action=edit Bug 17770: Improve perlcritic level before patch: perlcritic -4 noisy after patch: perlcritic -4 ok Signed-off-by: Your Full Name <your_email> Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 --- Comment #24 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 70007 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70007&action=edit Bug 17770: Perltidy Signed-off-by: Your Full Name <your_email> Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 --- Comment #25 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- "Sitemapper.t fails if date changes during test run" is the description of the bug, not what the patch does. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #26 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 18.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com Status|Pushed to Master |Pushed to Stable --- Comment #27 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to stable for 17.11.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17770 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #28 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Pushed to 17.05.x for v17.05.08 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org