mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-09-10 23:02:46 +00:00
Remove polylith/API mode (#2967)
This removes most of the code used for polylith/API mode. This removes the `/api` internal endpoints entirely. Binary size change roughly 5%: ``` 51437560 Feb 13 10:15 dendrite-monolith-server # old 48759008 Feb 13 10:15 dendrite-monolith-server # new ```
This commit is contained in:
parent
cc59879faa
commit
11d9b9db0e
106 changed files with 374 additions and 5850 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Masterminds/semver/v3"
|
||||
"github.com/matrix-org/gomatrix"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
)
|
||||
|
@ -22,7 +23,8 @@ type user struct {
|
|||
// - register alice and bob with branch name muxed into the localpart
|
||||
// - create a DM room for the 2 users and exchange messages
|
||||
// - create/join a public #global room and exchange messages
|
||||
func runTests(baseURL, branchName string) error {
|
||||
func runTests(baseURL string, v *semver.Version) error {
|
||||
branchName, _ := versionToBranchAndBinary(v)
|
||||
// register 2 users
|
||||
users := []user{
|
||||
{
|
||||
|
@ -164,15 +166,16 @@ func runTests(baseURL, branchName string) error {
|
|||
}
|
||||
|
||||
// verifyTestsRan checks that the HS has the right rooms/messages
|
||||
func verifyTestsRan(baseURL string, branchNames []string) error {
|
||||
func verifyTestsRan(baseURL string, versions []*semver.Version) error {
|
||||
log.Println("Verifying tests....")
|
||||
// check we can login as all users
|
||||
var resp *gomatrix.RespLogin
|
||||
for _, branchName := range branchNames {
|
||||
for _, version := range versions {
|
||||
client, err := gomatrix.NewClient(baseURL, "", "")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
branchName, _ := versionToBranchAndBinary(version)
|
||||
userLocalparts := []string{
|
||||
"alice" + branchName,
|
||||
"bob" + branchName,
|
||||
|
@ -224,7 +227,7 @@ func verifyTestsRan(baseURL string, branchNames []string) error {
|
|||
msgCount += 1
|
||||
}
|
||||
}
|
||||
wantMsgCount := len(branchNames) * 4
|
||||
wantMsgCount := len(versions) * 4
|
||||
if msgCount != wantMsgCount {
|
||||
return fmt.Errorf("got %d messages in global room, want %d", msgCount, wantMsgCount)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue