mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-01 05:42:46 +00:00
Begin adding syncapi component tests (#2442)
* Add very basic syncapi tests * Add a way to inject jetstream messages * implement add_state_ids * bugfixes * Unbreak tests * Remove now un-needed API call * Linting
This commit is contained in:
parent
a443d1e5f3
commit
236b16aa6c
9 changed files with 337 additions and 11 deletions
|
@ -13,6 +13,7 @@ import (
|
|||
"github.com/sirupsen/logrus"
|
||||
|
||||
natsserver "github.com/nats-io/nats-server/v2/server"
|
||||
"github.com/nats-io/nats.go"
|
||||
natsclient "github.com/nats-io/nats.go"
|
||||
)
|
||||
|
||||
|
@ -21,6 +22,13 @@ type NATSInstance struct {
|
|||
sync.Mutex
|
||||
}
|
||||
|
||||
func DeleteAllStreams(js nats.JetStreamContext, cfg *config.JetStream) {
|
||||
for _, stream := range streams { // streams are defined in streams.go
|
||||
name := cfg.Prefixed(stream.Name)
|
||||
_ = js.DeleteStream(name)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *NATSInstance) Prepare(process *process.ProcessContext, cfg *config.JetStream) (natsclient.JetStreamContext, *natsclient.Conn) {
|
||||
// check if we need an in-process NATS Server
|
||||
if len(cfg.Addresses) != 0 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue