go-sprout / sprout

From sprig to sprout - Useful template functions for Go templates with steroids
https://sprout.atom.codes
MIT License
86 stars 4 forks source link

bug: tests failing due to timezone issues #41

Closed 42atomys closed 2 months ago

42atomys commented 2 months ago

Describe the bug

The tests are currently failing locally, indicating a potential problem with the timezone settings. The specific test in question is TestMustToDate and its subtest TestDate. The error message suggests that the expected and actual times are not equal, with the main difference being the timezone offset (+0000 UTC vs +0200 CEST).

To Reproduce

  1. Run the tests locally (offseting of UTC)
  2. Observe the failure of the TestMustToDate test

Expected behavior

The tests should pass without any errors or failures.

Code Snippet

--- FAIL: TestMustToDate (0.00s)
    --- FAIL: TestMustToDate/TestDate (0.00s)
        conversion_functions_test.go:143:
                Error Trace:    /Users/andig/htdocs/sprout/test_helpers_test.go:57
                Error:          Not equal:
                                expected: "time.Time-2024-05-09 00:00:00 +0000 UTC"
                                actual  : "time.Time-2024-05-09 00:00:00 +0200 CEST"


### Version of software

v0.4.0

### Additional context

This issue is likely related to recent changes in the formatting codebase, which were triggered by running gofmt. Further investigation is needed to determine the root cause of this problem.

See: https://github.com/go-sprout/sprout/pull/38#issuecomment-2159949706

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct
42atomys commented 2 months ago

This point raise a missing management of timezone in the library