diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2022-10-18 15:59:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-18 15:59:08 +0100 |
commit | 3aa92efaa3e814ad0596fc5fc174a2e43124dcf5 (patch) | |
tree | 9c49026e22f77e72d36802292fa1b3f26a3ddac1 /userapi/userapi_test.go | |
parent | 9c189b1b80f9c338ac3cfa71cdaca60016de45f7 (diff) |
Namespace user API tables (#2806)
This migrates all the various user API tables, indices and sequences to
be `userapi_`-namespaced, rather than the mess they are all now.
Diffstat (limited to 'userapi/userapi_test.go')
-rw-r--r-- | userapi/userapi_test.go | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/userapi/userapi_test.go b/userapi/userapi_test.go index 984fe885..4417f4dc 100644 --- a/userapi/userapi_test.go +++ b/userapi/userapi_test.go @@ -25,6 +25,7 @@ import ( "github.com/gorilla/mux" "github.com/matrix-org/dendrite/internal/httputil" "github.com/matrix-org/dendrite/test" + "github.com/matrix-org/dendrite/test/testrig" "github.com/matrix-org/dendrite/userapi" "github.com/matrix-org/dendrite/userapi/inthttp" "github.com/matrix-org/gomatrixserverlib" @@ -48,9 +49,9 @@ func MustMakeInternalAPI(t *testing.T, opts apiTestOpts, dbType test.DBType) (ap if opts.loginTokenLifetime == 0 { opts.loginTokenLifetime = api.DefaultLoginTokenLifetime * time.Millisecond } + base, baseclose := testrig.CreateBaseDendrite(t, dbType) connStr, close := test.PrepareDBConnectionString(t, dbType) - - accountDB, err := storage.NewUserAPIDatabase(nil, &config.DatabaseOptions{ + accountDB, err := storage.NewUserAPIDatabase(base, &config.DatabaseOptions{ ConnectionString: config.DataSource(connStr), }, serverName, bcrypt.MinCost, config.DefaultOpenIDTokenLifetimeMS, opts.loginTokenLifetime, "") if err != nil { @@ -64,9 +65,12 @@ func MustMakeInternalAPI(t *testing.T, opts apiTestOpts, dbType test.DBType) (ap } return &internal.UserInternalAPI{ - DB: accountDB, - ServerName: cfg.Matrix.ServerName, - }, accountDB, close + DB: accountDB, + ServerName: cfg.Matrix.ServerName, + }, accountDB, func() { + close() + baseclose() + } } func TestQueryProfile(t *testing.T) { |