aboutsummaryrefslogtreecommitdiff
path: root/federationapi/federationapi_keys_test.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-01-07 17:31:57 +0000
committerGitHub <noreply@github.com>2022-01-07 17:31:57 +0000
commit16035b97373849d74961e15616f3f1449f0a5abd (patch)
treeac99aeba1814aa2e9df950912e08ef595148a969 /federationapi/federationapi_keys_test.go
parenta42232143526de360309b112b57cf0d95adf47cb (diff)
NATS JetStream tweaks (#2086)
* Use named NATS durable consumers * Build fixes * Remove dupe call to SetFederationAPI * Use namespaced consumer name * Fix namespacing * Fix unit tests hopefully
Diffstat (limited to 'federationapi/federationapi_keys_test.go')
-rw-r--r--federationapi/federationapi_keys_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/federationapi/federationapi_keys_test.go b/federationapi/federationapi_keys_test.go
index b9503963..4774c882 100644
--- a/federationapi/federationapi_keys_test.go
+++ b/federationapi/federationapi_keys_test.go
@@ -68,6 +68,13 @@ func TestMain(m *testing.M) {
panic("can't create cache: " + err.Error())
}
+ // Create a temporary directory for JetStream.
+ d, err := ioutil.TempDir("./", "jetstream*")
+ if err != nil {
+ panic(err)
+ }
+ defer os.RemoveAll(d)
+
// Draw up just enough Dendrite config for the server key
// API to work.
cfg := &config.Dendrite{}
@@ -75,6 +82,8 @@ func TestMain(m *testing.M) {
cfg.Global.ServerName = gomatrixserverlib.ServerName(s.name)
cfg.Global.PrivateKey = testPriv
cfg.Global.JetStream.InMemory = true
+ cfg.Global.JetStream.TopicPrefix = string(s.name[:1])
+ cfg.Global.JetStream.StoragePath = config.Path(d)
cfg.Global.KeyID = serverKeyID
cfg.Global.KeyValidityPeriod = s.validity
cfg.FederationAPI.Database.ConnectionString = config.DataSource("file::memory:")