mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 10:33:11 -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
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
@ -219,14 +220,19 @@ func verifyTestsRan(baseURL string, branchNames []string) error {
|
||||||
}
|
}
|
||||||
// we expect 4 messages per version
|
// we expect 4 messages per version
|
||||||
msgCount := 0
|
msgCount := 0
|
||||||
|
// To aid debugging when some messages are missing
|
||||||
|
msgArray := make([]gomatrix.Event, 0)
|
||||||
|
|
||||||
for _, ev := range history.Chunk {
|
for _, ev := range history.Chunk {
|
||||||
if ev.Type == "m.room.message" {
|
if ev.Type == "m.room.message" {
|
||||||
msgCount += 1
|
msgCount += 1
|
||||||
|
msgArray = append(msgArray, ev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wantMsgCount := len(branchNames) * 4
|
wantMsgCount := len(branchNames) * 4
|
||||||
if msgCount != wantMsgCount {
|
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")
|
log.Println(" messages exist: OK")
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue