mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 22:22:46 +00:00
Remove BaseDendrite
(#3023)
Removes `BaseDendrite` to, hopefully, make testing and composing of components easier in the future.
This commit is contained in:
parent
ec6879e5ae
commit
5e85a00cb3
68 changed files with 1186 additions and 1002 deletions
|
@ -15,13 +15,13 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/matrix-org/dendrite/setup/process"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
|
||||
"github.com/matrix-org/dendrite/internal/hooks"
|
||||
"github.com/matrix-org/dendrite/internal/httputil"
|
||||
"github.com/matrix-org/dendrite/internal/sqlutil"
|
||||
roomserver "github.com/matrix-org/dendrite/roomserver/api"
|
||||
"github.com/matrix-org/dendrite/setup/base"
|
||||
"github.com/matrix-org/dendrite/setup/config"
|
||||
"github.com/matrix-org/dendrite/setup/mscs/msc2836"
|
||||
userapi "github.com/matrix-org/dendrite/userapi/api"
|
||||
|
@ -555,21 +555,18 @@ func injectEvents(t *testing.T, userAPI userapi.UserInternalAPI, rsAPI roomserve
|
|||
cfg.Global.ServerName = "localhost"
|
||||
cfg.MSCs.Database.ConnectionString = "file:msc2836_test.db"
|
||||
cfg.MSCs.MSCs = []string{"msc2836"}
|
||||
cm := sqlutil.NewConnectionManager()
|
||||
base := &base.BaseDendrite{
|
||||
Cfg: cfg,
|
||||
Routers: httputil.NewRouters(),
|
||||
ConnectionManager: cm,
|
||||
}
|
||||
|
||||
err := msc2836.Enable(base, rsAPI, nil, userAPI, nil)
|
||||
processCtx := process.NewProcessContext()
|
||||
cm := sqlutil.NewConnectionManager(processCtx, cfg.Global.DatabaseOptions)
|
||||
routers := httputil.NewRouters()
|
||||
err := msc2836.Enable(cfg, cm, routers, rsAPI, nil, userAPI, nil)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to enable MSC2836: %s", err)
|
||||
}
|
||||
for _, ev := range events {
|
||||
hooks.Run(hooks.KindNewEventPersisted, ev)
|
||||
}
|
||||
return base.Routers.Client
|
||||
return routers.Client
|
||||
}
|
||||
|
||||
type fledglingEvent struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue