mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 18:43:10 -06:00
Log events that are found when the dendrite-upgrade-tests fail to aid debugging
Signed-off-by: Brian Meek <brian@hntlabs.com>
This commit is contained in:
parent
be116212c3
commit
9e24a8d9cc
|
|
@ -1,6 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"strings"
|
||||
|
|
@ -219,14 +220,19 @@ func verifyTestsRan(baseURL string, branchNames []string) error {
|
|||
}
|
||||
// we expect 4 messages per version
|
||||
msgCount := 0
|
||||
// To aid debugging when some messages are missing
|
||||
msgArray := make([]gomatrix.Event, 0)
|
||||
|
||||
for _, ev := range history.Chunk {
|
||||
if ev.Type == "m.room.message" {
|
||||
msgCount += 1
|
||||
msgArray = append(msgArray, ev)
|
||||
}
|
||||
}
|
||||
wantMsgCount := len(branchNames) * 4
|
||||
if msgCount != wantMsgCount {
|
||||
return fmt.Errorf("got %d messages in global room, want %d", msgCount, wantMsgCount)
|
||||
msgArrayJSON, _ := json.Marshal(msgArray)
|
||||
return fmt.Errorf("got %d messages in global room, want %d msgArray %v", msgCount, wantMsgCount, msgArrayJSON)
|
||||
}
|
||||
log.Println(" messages exist: OK")
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue