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

@ -11,7 +11,7 @@ jobs:
- image: cimg/go:1.23.6
# Please keep the version in sync with test/docker-compose.yaml
- image: cimg/postgres:14.10
- image: cimg/postgres:14.1
environment:
POSTGRES_USER: jet
POSTGRES_PASSWORD: jet
@ -29,7 +29,7 @@ jobs:
MYSQL_TCP_PORT: 50902
# Please keep the version in sync with test/docker-compose.yaml
- image: circleci/mariadb:11.7
- image: cimg/mariadb:11.4
command: [ '--default-authentication-plugin=mysql_native_password', '--port=50903' ]
environment:
MYSQL_ROOT_PASSWORD: jet

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