digital-preservation/droid

Dependabot PR to update to joda-time failed a few tests

sparkhi opened this issue · 1 comments

Before updating joda-time, we should look at these failures. The mismatches seem to be one hour out on dates in winter and we don't seem to use "Z" in date time

Error:  Failures: 
Error:    CsvItemWriterTest.shouldCreateAdditionalHeadersForIdentificationFormatsWhenWritingAnEntryPerFile:300 expected:<...,"foo","1970-01-01T0[4]:25:45","false","111...> but was:<...,"foo","1970-01-01T0[3]:25:45","false","111...>
Error:    CsvItemWriterTest.testWriteNodeWithNullFormat:201 expected:<...,"foo","1970-01-01T0[4]:25:45","false","111...> but was:<...,"foo","1970-01-01T0[3]:25:45","false","111...>
Error:    CsvItemWriterTest.testWriteOneNode:158 expected:<...,"foo","1970-01-01T0[4]:25:45","false","111...> but was:<...,"foo","1970-01-01T0[3]:25:45","false","111...>
Error:    CsvItemWriterTest.testWriteOneNodeWithNullSize:243 expected:<...,"foo","1970-01-01T0[4]:25:45","false","111...> but was:<...,"foo","1970-01-01T0[3]:25:45","false","111...>
Error:    CsvItemWriterTest.testWriteOneNodeWithTwoFormatsWithOneRowPerFormat:366 expected:<...,"foo","1970-01-01T0[4]:25:45","false","111...> but was:<...,"foo","1970-01-01T0[3]:25:45","false","111...>
Error:    FileWalkerPersistenceTest.testSaveProfileWithSerializedPofileSpecWalker:148

I had done a little bit of digging into this and it is not the joda-time but a combination of our tests and github actions environment that is causing an issue.

Our tests are written to get time in the local time zone, github actions may execute the tests somewhere else , hence a mismatch can occur. I had written a small piece of code and tests elsewhere to get better understanding
https://github.com/sparkhi/joda-time-test