aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2022-09-07 18:15:54 +0200
committerGitHub <noreply@github.com>2022-09-07 18:15:54 +0200
commitd5876abbe9f5484768f603ec91a567b8650e6e73 (patch)
treee8288bac7557a840ed636391ce5afbc7059dc993 /test
parent31f4ae8997af7e939f505107341b86b2abd3fd9a (diff)
Fulltext implementation incl. config (#2480)
This adds the main component of the fulltext search. This PR doesn't do anything yet, besides creating an empty fulltextindex folder if enabled. Indexing events is done in a separate PR.
Diffstat (limited to 'test')
-rw-r--r--test/testrig/base.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/testrig/base.go b/test/testrig/base.go
index 9747ea60..10cc2407 100644
--- a/test/testrig/base.go
+++ b/test/testrig/base.go
@@ -22,10 +22,11 @@ import (
"strings"
"testing"
+ "github.com/nats-io/nats.go"
+
"github.com/matrix-org/dendrite/setup/base"
"github.com/matrix-org/dendrite/setup/config"
"github.com/matrix-org/dendrite/test"
- "github.com/nats-io/nats.go"
)
func CreateBaseDendrite(t *testing.T, dbType test.DBType) (*base.BaseDendrite, func()) {
@@ -45,6 +46,10 @@ func CreateBaseDendrite(t *testing.T, dbType test.DBType) (*base.BaseDendrite, f
Generate: true,
Monolithic: true,
})
+ cfg.SyncAPI.Fulltext.Defaults(config.DefaultOpts{ // use in memory fts
+ Generate: true,
+ Monolithic: true,
+ })
cfg.Global.ServerName = "test"
// use a distinct prefix else concurrent postgres/sqlite runs will clash since NATS will use
// the file system event with InMemory=true :(
@@ -100,6 +105,7 @@ func Base(cfg *config.Dendrite) (*base.BaseDendrite, nats.JetStreamContext, *nat
})
}
cfg.Global.JetStream.InMemory = true
+ cfg.SyncAPI.Fulltext.InMemory = true
base := base.NewBaseDendrite(cfg, "Tests")
js, jc := base.NATS.Prepare(base.ProcessContext, &cfg.Global.JetStream)
return base, js, jc