aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-05-09 14:15:24 +0100
committerGitHub <noreply@github.com>2022-05-09 14:15:24 +0100
commit09d754cfbf9268044d0f59fbe509640b8d71e011 (patch)
tree23922c3b718c3317651fcd95da85f6f0765662f4 /test
parent79e2fbc66368d8f4754b9fff8005d3e77969fcc4 (diff)
One NATS instance per `BaseDendrite` (#2438)
* One NATS instance per `BaseDendrite` * Fix roomserver
Diffstat (limited to 'test')
-rw-r--r--test/base.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/base.go b/test/base.go
new file mode 100644
index 00000000..32fc8dc5
--- /dev/null
+++ b/test/base.go
@@ -0,0 +1,18 @@
+package test
+
+import (
+ "github.com/matrix-org/dendrite/setup/base"
+ "github.com/matrix-org/dendrite/setup/config"
+ "github.com/nats-io/nats.go"
+)
+
+func Base(cfg *config.Dendrite) (*base.BaseDendrite, nats.JetStreamContext, *nats.Conn) {
+ if cfg == nil {
+ cfg = &config.Dendrite{}
+ cfg.Defaults(true)
+ }
+ cfg.Global.JetStream.InMemory = true
+ base := base.NewBaseDendrite(cfg, "Tests")
+ js, jc := base.NATS.Prepare(base.ProcessContext, &cfg.Global.JetStream)
+ return base, js, jc
+}