Add client API topic to tests

This commit is contained in:
Brendan Abolivier 2017-07-31 15:46:13 +01:00
parent eefbebbc79
commit fd64eff7a4
No known key found for this signature in database
GPG key ID: 8EF1500759F70623
2 changed files with 7 additions and 0 deletions

View file

@ -54,6 +54,7 @@ var (
)
const inputTopic = "syncserverInput"
const clientTopic = "clientapiOutput"
var exe = test.KafkaExecutor{
ZookeeperURI: zookeeperURI,
@ -134,6 +135,7 @@ func startSyncServer() (*exec.Cmd, chan error) {
cfg.Matrix.ServerName = "localhost"
cfg.Listen.SyncAPI = config.Address(syncserverAddr)
cfg.Kafka.Topics.OutputRoomEvent = config.Topic(inputTopic)
cfg.Kafka.Topics.OutputClientData = config.Topic(clientTopic)
if err := test.WriteConfig(cfg, dir); err != nil {
panic(err)
@ -177,6 +179,10 @@ func prepareKafka() {
if err := exe.CreateTopic(inputTopic); err != nil {
panic(err)
}
exe.DeleteTopic(clientTopic)
if err := exe.CreateTopic(clientTopic); err != nil {
panic(err)
}
}
func testSyncServer(syncServerCmdChan chan error, userID, since, want string) {

View file

@ -300,6 +300,7 @@ func (config *Dendrite) check() error {
checkNotZero("kafka.addresses", int64(len(config.Kafka.Addresses)))
checkNotEmpty("kafka.topics.output_room_event", string(config.Kafka.Topics.OutputRoomEvent))
checkNotEmpty("kafka.topics.output_client_data", string(config.Kafka.Topics.OutputClientData))
checkNotEmpty("database.account", string(config.Database.Account))
checkNotEmpty("database.device", string(config.Database.Device))
checkNotEmpty("database.server_key", string(config.Database.ServerKey))