Skip to content

Commit 6fe2f86

Browse files
committed
Fix tests and update circle.ci
1 parent f20bf50 commit 6fe2f86

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- image: cimg/go:1.23.6
1212

1313
# Please keep the version in sync with test/docker-compose.yaml
14-
- image: cimg/postgres:14.10
14+
- image: cimg/postgres:14.1
1515
environment:
1616
POSTGRES_USER: jet
1717
POSTGRES_PASSWORD: jet
@@ -29,7 +29,7 @@ jobs:
2929
MYSQL_TCP_PORT: 50902
3030

3131
# Please keep the version in sync with test/docker-compose.yaml
32-
- image: circleci/mariadb:11.7
32+
- image: cimg/mariadb:11.4
3333
command: [ '--default-authentication-plugin=mysql_native_password', '--port=50903' ]
3434
environment:
3535
MYSQL_ROOT_PASSWORD: jet

tests/postgres/alltypes_test.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,23 @@ func TestAllTypesSelectJson(t *testing.T) {
7676
}
7777

7878
// set time local before comparison
79-
dest[0].Timestampz = dest[0].Timestampz.Local()
79+
dest[0].Timestampz = toCET(t, dest[0].Timestampz)
8080

8181
if dest[0].TimestampzPtr != nil {
82-
dest[0].TimestampzPtr = ptr.Of(dest[0].TimestampzPtr.Local())
82+
dest[0].TimestampzPtr = ptr.Of(toCET(t, *dest[0].TimestampzPtr))
8383
}
84-
dest[1].Timestampz = dest[1].Timestampz.Local()
84+
dest[1].Timestampz = toCET(t, dest[1].Timestampz)
8585

86-
require.Equal(t, dest[0], allTypesRow0)
87-
require.Equal(t, dest[1], allTypesRow1)
86+
testutils.AssertJsonEqual(t, dest[0], allTypesRow0)
87+
testutils.AssertJsonEqual(t, dest[1], allTypesRow1)
88+
}
89+
90+
func toCET(t *testing.T, tm time.Time) time.Time {
91+
cet, err := time.LoadLocation("CET") // "Europe/Berlin" also works
92+
if err != nil {
93+
t.Fail()
94+
}
95+
return tm.In(cet)
8896
}
8997

9098
func TestAllTypesViewSelect(t *testing.T) {

tests/postgres/select_json_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ FROM (
4646

4747
err = stmt.QueryJSON(ctx, db, &dest2)
4848
require.NoError(t, err)
49-
testutils.PrintJson(dest2)
49+
//testutils.PrintJson(dest2)
5050
testutils.AssertDeepEqual(t, dest2, map[string]interface{}{
5151
"actorID": float64(2),
5252
"firstName": "Nick",

tests/testdata

0 commit comments

Comments
 (0)