vincentdephily / emlop

EMerge LOg Parser
GNU General Public License v3.0
38 stars 4 forks source link

timespan_next test fails with `Z` vs `+00:00` suffix #21

Closed vincentdephily closed 2 years ago

vincentdephily commented 2 years ago

Extracted from #19

---- commands::tests::timespan_next_ stdout ----
thread 'commands::tests::timespan_next_' panicked at 'assertion failed: `(left == right)`
  left: `2020-01-01T00:00:00+00:00`,
 right: `2019-12-31T13:00:00Z`: year 2019-01-01T00:00:00+00:00', src/commands.rs:852:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I'm guessing that this is a timezone issue, despite trying to force the unittest to UTC. Maybe a mismatch between the UTC test and the Local code ? Not sure yet.

@flexibeast what is your locale and timezone, so I can try to reproduce ?

flexibeast commented 2 years ago

@vincentdephily:

/etc/locale.gen:

en_AU.UTF-8 UTF-8
C.UTF8 UTF-8

# env | grep -i lang:

LANG=en_AU.UTF-8

# file /etc/localtime:

/etc/localtime: symbolic link to /usr/share/zoneinfo/Australia/Melbourne
vincentdephily commented 2 years ago

This bug should be fixed now, and the CI now runs the unittests on multiple timezones.

However, the fix currently forces timespans to UTC, which isn't a big issue for stats grouping but should still be fixed, so I'm leaving this bug open for a while longer.