aboutsummaryrefslogtreecommitdiff
path: root/userapi/internal
diff options
context:
space:
mode:
Diffstat (limited to 'userapi/internal')
-rw-r--r--userapi/internal/device_list_update_test.go6
-rw-r--r--userapi/internal/key_api_test.go7
2 files changed, 6 insertions, 7 deletions
diff --git a/userapi/internal/device_list_update_test.go b/userapi/internal/device_list_update_test.go
index 868fc9be..6ccc4b5f 100644
--- a/userapi/internal/device_list_update_test.go
+++ b/userapi/internal/device_list_update_test.go
@@ -27,13 +27,13 @@ import (
"testing"
"time"
+ "github.com/matrix-org/dendrite/internal/sqlutil"
"github.com/matrix-org/gomatrixserverlib"
roomserver "github.com/matrix-org/dendrite/roomserver/api"
"github.com/matrix-org/dendrite/setup/config"
"github.com/matrix-org/dendrite/setup/process"
"github.com/matrix-org/dendrite/test"
- "github.com/matrix-org/dendrite/test/testrig"
"github.com/matrix-org/dendrite/userapi/api"
"github.com/matrix-org/dendrite/userapi/storage"
)
@@ -363,9 +363,9 @@ func TestDebounce(t *testing.T) {
func mustCreateKeyserverDB(t *testing.T, dbType test.DBType) (storage.KeyDatabase, func()) {
t.Helper()
- base, _, _ := testrig.Base(nil)
connStr, clearDB := test.PrepareDBConnectionString(t, dbType)
- db, err := storage.NewKeyDatabase(base, &config.DatabaseOptions{ConnectionString: config.DataSource(connStr)})
+ cm := sqlutil.NewConnectionManager()
+ db, err := storage.NewKeyDatabase(cm, &config.DatabaseOptions{ConnectionString: config.DataSource(connStr)})
if err != nil {
t.Fatal(err)
}
diff --git a/userapi/internal/key_api_test.go b/userapi/internal/key_api_test.go
index fc7e7e0d..ec315c73 100644
--- a/userapi/internal/key_api_test.go
+++ b/userapi/internal/key_api_test.go
@@ -5,9 +5,9 @@ import (
"reflect"
"testing"
+ "github.com/matrix-org/dendrite/internal/sqlutil"
"github.com/matrix-org/dendrite/setup/config"
"github.com/matrix-org/dendrite/test"
- "github.com/matrix-org/dendrite/test/testrig"
"github.com/matrix-org/dendrite/userapi/api"
"github.com/matrix-org/dendrite/userapi/internal"
"github.com/matrix-org/dendrite/userapi/storage"
@@ -16,15 +16,14 @@ import (
func mustCreateDatabase(t *testing.T, dbType test.DBType) (storage.KeyDatabase, func()) {
t.Helper()
connStr, close := test.PrepareDBConnectionString(t, dbType)
- base, _, _ := testrig.Base(nil)
- db, err := storage.NewKeyDatabase(base, &config.DatabaseOptions{
+ cm := sqlutil.NewConnectionManager()
+ db, err := storage.NewKeyDatabase(cm, &config.DatabaseOptions{
ConnectionString: config.DataSource(connStr),
})
if err != nil {
t.Fatalf("failed to create new user db: %v", err)
}
return db, func() {
- base.Close()
close()
}
}