diff --git a/.circleci/config.yml b/.circleci/config.yml index f74334f..cd6e14e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/tests/postgres/alltypes_test.go b/tests/postgres/alltypes_test.go index e28322d..a411071 100644 --- a/tests/postgres/alltypes_test.go +++ b/tests/postgres/alltypes_test.go @@ -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) { diff --git a/tests/postgres/select_json_test.go b/tests/postgres/select_json_test.go index 517df9a..a67eb71 100644 --- a/tests/postgres/select_json_test.go +++ b/tests/postgres/select_json_test.go @@ -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", diff --git a/tests/testdata b/tests/testdata index 0997c82..e35d57e 160000 --- a/tests/testdata +++ b/tests/testdata @@ -1 +1 @@ -Subproject commit 0997c825e6569fc49b69ffbef959eadab9013e00 +Subproject commit e35d57ed1539aa759ef3fade06086d639286854e