Jonathan Druart
c1513a10c3
I have no idea why this only appears today but TestBuilder generates dates using DateTime->now, which does not take into account the timezone. It has been highlights by a failing test today on U18. Why today whereas this patch was pushed few weeks ago? Why U18 and not D9? The output of the test is: koha_1 | # Failed test 'With BorrowerLogs and TrackLastPatronActivity we should not spam the logs' koha_1 | # at t/db_dependent/Koha/Patrons.t line 1421. koha_1 | # got: '2' koha_1 | # expected: '1' koha_1 | # Looks like you failed 1 test of 4. koha_1 | koha_1 | # Failed test 'BorrowersLog tests' koha_1 | # at t/db_dependent/Koha/Patrons.t line 1422. koha_1 | # Looks like you failed 1 test of 33. koha_1 | [19:51:44] t/db_dependent/Koha/Patrons.t Actually there are 2 logs, one for the cardnumber that is expected, and on for updated_on: "updated_on" : { "after" : "2019-03-04 21:10:00", "before" : "2019-03-04 18:10:00" } Apart from the fact that we may want to remove this updated_on field from MODIFY, the before/after dates differ from 3 hours. Here it's currently 18:10 and in UTC-3 To prevent such behaviors in tests (create stuffs in the future...), we should use our Koha::DateUtils::dt_from_string method that takes care of the timezone used in other places of Koha. Test plan: prove t/db_dependent/Koha/Patrons.t May fail without this patch. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> This patch is fine in itself, but there may still be an issue around the failing test for TrackLastPatronActivity. Reopened bug 22741. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> |
||
---|---|---|
.. | ||
Acquisition | ||
Biblio | ||
Budgets | ||
Circulation | ||
db_dependent | ||
edi_testfiles | ||
etc | ||
External | ||
Koha | ||
LangInstaller/templates | ||
lib | ||
Members | ||
Number | ||
Search | ||
Serials | ||
SIP | ||
Test | ||
00-checkdatabase-version.t | ||
00-deprecated.t | ||
00-load.t | ||
00-merge-conflict-markers.t | ||
00-testcritic.t | ||
00-valid-xml.t | ||
Auth_with_shibboleth.t | ||
AuthoritiesMarc_MARC21.t | ||
AuthoritiesMarc_UNIMARC.t | ||
AuthUtils.t | ||
Barcodes_annual.t | ||
Barcodes_EAN13.t | ||
Barcodes_hbyymmincr.t | ||
Barcodes_incremental.t | ||
Biblio.t | ||
Biblio2.t | ||
Bookseller.t | ||
Boolean.t | ||
Budgets.t | ||
Calendar.t | ||
Charset.t | ||
Circulation_barcodedecode.t | ||
ClassSortRoutine.t | ||
ClassSortRoutine_Dewey.t | ||
ClassSortRoutine_Generic.t | ||
ClassSortRoutine_LCC.t | ||
ClassSource.t | ||
Context.t | ||
Contract.t | ||
Creators.t | ||
DateUtils.t | ||
Debug.t | ||
dummy.t | ||
Edifact.t | ||
EdiInvoice.t | ||
Ediorder.t | ||
Ediordrsp.t | ||
Form_MessagingPreferences.t | ||
HtmlTags.t | ||
Images.t | ||
ImportBatch.t | ||
Installer_PerlDependencies.t | ||
Installer_PerlModules.t | ||
Installer_pm.t | ||
ItemCirculationAlertPreference.t | ||
Koha.t | ||
Koha_Email.t | ||
Koha_MetadataRecord.t | ||
Koha_Template_Plugin_Cache.t | ||
Koha_Template_Plugin_Koha.t | ||
Koha_Util_FrameworkPlugin.t | ||
Koha_Util_MARC.t | ||
Labels.t | ||
Labels_split_ccn.t | ||
Labels_split_ddcn.t | ||
Labels_split_lccn.t | ||
Labels_split_Regex.t | ||
LangInstaller.t | ||
Languages.t | ||
Letters.t | ||
Log.t | ||
Logger.t | ||
Makefile.t | ||
Matcher.t | ||
Members_Attributes.t | ||
Members_AttributeTypes.t | ||
Members_Messaging.t | ||
OpenLibrarySearch.t | ||
Output.t | ||
Output_JSONStream.t | ||
Patron.t | ||
Patroncards.t | ||
Patroncards_Batch.t | ||
Patroncards_Layout.t | ||
Patroncards_Lib.t | ||
Patroncards_Patroncard.t | ||
Patroncards_Profile.t | ||
Patroncards_Template.t | ||
perlcriticrc | ||
Prices.t | ||
Print.t | ||
QueryParser.t | ||
RecordProcessor.t | ||
Ris.t | ||
Scheduler.t | ||
Scrubber.t | ||
Search.t | ||
Search_PazPar2.t | ||
SimpleMARC.t | ||
SMS.t | ||
SocialData.t | ||
Stats.t | ||
SuggestionEngine.t | ||
SuggestionEngine_AuthorityFile.t | ||
template_filters.t | ||
timezones.t | ||
TmplToken.t | ||
Token.t | ||
XSLT.t |