diff --git a/clientapi/auth/storage/devices/storage_test.go b/clientapi/auth/storage/devices/storage_test.go index 2d0f91cb6..a43126b18 100644 --- a/clientapi/auth/storage/devices/storage_test.go +++ b/clientapi/auth/storage/devices/storage_test.go @@ -14,6 +14,7 @@ import ( var dataSource string var insideCi = false var insideDocker = false + const dbName = "dendrite_device" func init() { @@ -32,12 +33,11 @@ func init() { if insideCi { dataSource = fmt.Sprintf("postgres://postgres@localhost/%s?sslmode=disable", dbName) } else if insideDocker { - dataSource = fmt.Sprintf("postgres://dendrite:itsasecret@localhost/%s?sslmode=disable", dbName) + dataSource = fmt.Sprintf("postgres://dendrite:itsasecret@postgres/%s?sslmode=disable", dbName) } else { dataSource = fmt.Sprintf("postgres://dendrite:itsasecret@localhost:15432/%s?sslmode=disable", dbName) } - if insideCi { database := "dendrite_device" cmd := exec.Command("psql", database) @@ -52,8 +52,6 @@ func init() { } } - - type deviceSpec struct { localPart string devID string diff --git a/syncapi/storage/output_room_events_table_test.go b/syncapi/storage/output_room_events_table_test.go index d3891ca2b..1ec2ea1e6 100644 --- a/syncapi/storage/output_room_events_table_test.go +++ b/syncapi/storage/output_room_events_table_test.go @@ -16,6 +16,7 @@ import ( var dataSource string var insideCi = false var insideDocker = false + const dbName = "dendrite_syncapi" func init() { @@ -34,7 +35,7 @@ func init() { if insideCi { dataSource = fmt.Sprintf("postgres://postgres@localhost/%s?sslmode=disable", dbName) } else if insideDocker { - dataSource = fmt.Sprintf("postgres://dendrite:itsasecret@localhost/%s?sslmode=disable", dbName) + dataSource = fmt.Sprintf("postgres://dendrite:itsasecret@postgres/%s?sslmode=disable", dbName) } else { dataSource = fmt.Sprintf("postgres://dendrite:itsasecret@localhost:15432/%s?sslmode=disable", dbName) }