Fix tests and update circle.ci

This commit is contained in:
go-jet 2025-02-22 18:32:57 +01:00
parent f20bf50879
commit 6fe2f8605e
4 changed files with 17 additions and 9 deletions

View file

@ -76,15 +76,23 @@ func TestAllTypesSelectJson(t *testing.T) {
}
// set time local before comparison
dest[0].Timestampz = dest[0].Timestampz.Local()
dest[0].Timestampz = toCET(t, dest[0].Timestampz)
if dest[0].TimestampzPtr != nil {
dest[0].TimestampzPtr = ptr.Of(dest[0].TimestampzPtr.Local())
dest[0].TimestampzPtr = ptr.Of(toCET(t, *dest[0].TimestampzPtr))
}
dest[1].Timestampz = dest[1].Timestampz.Local()
dest[1].Timestampz = toCET(t, dest[1].Timestampz)
require.Equal(t, dest[0], allTypesRow0)
require.Equal(t, dest[1], allTypesRow1)
testutils.AssertJsonEqual(t, dest[0], allTypesRow0)
testutils.AssertJsonEqual(t, dest[1], allTypesRow1)
}
func toCET(t *testing.T, tm time.Time) time.Time {
cet, err := time.LoadLocation("CET") // "Europe/Berlin" also works
if err != nil {
t.Fail()
}
return tm.In(cet)
}
func TestAllTypesViewSelect(t *testing.T) {

View file

@ -46,7 +46,7 @@ FROM (
err = stmt.QueryJSON(ctx, db, &dest2)
require.NoError(t, err)
testutils.PrintJson(dest2)
//testutils.PrintJson(dest2)
testutils.AssertDeepEqual(t, dest2, map[string]interface{}{
"actorID": float64(2),
"firstName": "Nick",

@ -1 +1 @@
Subproject commit 0997c825e6569fc49b69ffbef959eadab9013e00
Subproject commit e35d57ed1539aa759ef3fade06086d639286854e