diff options
author | Till <2353100+S7evinK@users.noreply.github.com> | 2023-02-14 12:47:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-14 12:47:47 +0100 |
commit | 11d9b9db0e96c51c1430d451d23cf5ae9f36e4ee (patch) | |
tree | a0837bfa69051295b76140e3940a45fc61854cab /test | |
parent | cc59879faa57cac043cf5f1585773b301994bebf (diff) |
Remove polylith/API mode (#2967)
This removes most of the code used for polylith/API mode.
This removes the `/api` internal endpoints entirely.
Binary size change roughly 5%:
```
51437560 Feb 13 10:15 dendrite-monolith-server # old
48759008 Feb 13 10:15 dendrite-monolith-server # new
```
Diffstat (limited to 'test')
-rw-r--r-- | test/testrig/base.go | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/test/testrig/base.go b/test/testrig/base.go index dfc0d8aa..bb8fded2 100644 --- a/test/testrig/base.go +++ b/test/testrig/base.go @@ -28,24 +28,24 @@ import ( func CreateBaseDendrite(t *testing.T, dbType test.DBType) (*base.BaseDendrite, func()) { var cfg config.Dendrite cfg.Defaults(config.DefaultOpts{ - Generate: false, - Monolithic: true, + Generate: false, + SingleDatabase: true, }) cfg.Global.JetStream.InMemory = true cfg.FederationAPI.KeyPerspectives = nil switch dbType { case test.DBTypePostgres: cfg.Global.Defaults(config.DefaultOpts{ // autogen a signing key - Generate: true, - Monolithic: true, + Generate: true, + SingleDatabase: true, }) cfg.MediaAPI.Defaults(config.DefaultOpts{ // autogen a media path - Generate: true, - Monolithic: true, + Generate: true, + SingleDatabase: true, }) cfg.SyncAPI.Fulltext.Defaults(config.DefaultOpts{ // use in memory fts - Generate: true, - Monolithic: true, + Generate: true, + SingleDatabase: true, }) cfg.Global.ServerName = "test" // use a distinct prefix else concurrent postgres/sqlite runs will clash since NATS will use @@ -58,7 +58,7 @@ func CreateBaseDendrite(t *testing.T, dbType test.DBType) (*base.BaseDendrite, f MaxIdleConnections: 2, ConnMaxLifetimeSeconds: 60, } - base := base.NewBaseDendrite(&cfg, "Test", base.DisableMetrics) + base := base.NewBaseDendrite(&cfg, base.DisableMetrics) return base, func() { base.ShutdownDendrite() base.WaitForShutdown() @@ -66,8 +66,8 @@ func CreateBaseDendrite(t *testing.T, dbType test.DBType) (*base.BaseDendrite, f } case test.DBTypeSQLite: cfg.Defaults(config.DefaultOpts{ - Generate: true, - Monolithic: true, + Generate: true, + SingleDatabase: false, }) cfg.Global.ServerName = "test" @@ -86,7 +86,7 @@ func CreateBaseDendrite(t *testing.T, dbType test.DBType) (*base.BaseDendrite, f cfg.UserAPI.AccountDatabase.ConnectionString = config.DataSource(filepath.Join("file://", tempDir, "userapi.db")) cfg.RelayAPI.Database.ConnectionString = config.DataSource(filepath.Join("file://", tempDir, "relayapi.db")) - base := base.NewBaseDendrite(&cfg, "Test", base.DisableMetrics) + base := base.NewBaseDendrite(&cfg, base.DisableMetrics) return base, func() { base.ShutdownDendrite() base.WaitForShutdown() @@ -102,14 +102,14 @@ func Base(cfg *config.Dendrite) (*base.BaseDendrite, nats.JetStreamContext, *nat if cfg == nil { cfg = &config.Dendrite{} cfg.Defaults(config.DefaultOpts{ - Generate: true, - Monolithic: true, + Generate: true, + SingleDatabase: false, }) } cfg.Global.JetStream.InMemory = true cfg.SyncAPI.Fulltext.InMemory = true cfg.FederationAPI.KeyPerspectives = nil - base := base.NewBaseDendrite(cfg, "Tests", base.DisableMetrics) + base := base.NewBaseDendrite(cfg, base.DisableMetrics) js, jc := base.NATS.Prepare(base.ProcessContext, &cfg.Global.JetStream) return base, js, jc } |