mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 13:22:46 +00:00
Consolidation of roomserver APIs (#994)
* Consolidation of roomserver APIs * Comment out alias tests for now, they are broken * Wire AS API into roomserver again * Roomserver didn't take asAPI param before so return to that * Prevent roomserver asking AS API for alias info * Rename some files * Remove alias_test, incoherent tests and unwanted appservice integration * Remove FS API inject on syncapi component
This commit is contained in:
parent
ebbfc12592
commit
e15f6676ac
72 changed files with 894 additions and 1170 deletions
|
@ -209,7 +209,7 @@ func writeToRoomServer(input []string, roomserverURL string) error {
|
|||
return err
|
||||
}
|
||||
}
|
||||
x, err := api.NewRoomserverInputAPIHTTP(roomserverURL, &http.Client{Timeout: timeoutHTTP})
|
||||
x, err := api.NewRoomserverInternalAPIHTTP(roomserverURL, &http.Client{Timeout: timeoutHTTP}, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ func writeToRoomServer(input []string, roomserverURL string) error {
|
|||
// Once those messages have been written it runs the checkQueries function passing
|
||||
// a api.RoomserverQueryAPI client. The caller can use this function to check the
|
||||
// behaviour of the query API.
|
||||
func testRoomserver(input []string, wantOutput []string, checkQueries func(api.RoomserverQueryAPI)) {
|
||||
func testRoomserver(input []string, wantOutput []string, checkQueries func(api.RoomserverInternalAPI)) {
|
||||
dir, err := ioutil.TempDir("", "room-server-test")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
@ -276,7 +276,7 @@ func testRoomserver(input []string, wantOutput []string, checkQueries func(api.R
|
|||
cmd.Args = []string{"dendrite-room-server", "--config", filepath.Join(dir, test.ConfigFile)}
|
||||
|
||||
gotOutput, err := runAndReadFromTopic(cmd, cfg.RoomServerURL()+"/metrics", doInput, outputTopic, len(wantOutput), func() {
|
||||
queryAPI, _ := api.NewRoomserverQueryAPIHTTP("http://"+string(cfg.Listen.RoomServer), &http.Client{Timeout: timeoutHTTP}, cache)
|
||||
queryAPI, _ := api.NewRoomserverInternalAPIHTTP("http://"+string(cfg.Listen.RoomServer), &http.Client{Timeout: timeoutHTTP}, cache)
|
||||
checkQueries(queryAPI)
|
||||
})
|
||||
if err != nil {
|
||||
|
@ -410,7 +410,7 @@ func main() {
|
|||
}}`,
|
||||
}
|
||||
|
||||
testRoomserver(input, want, func(q api.RoomserverQueryAPI) {
|
||||
testRoomserver(input, want, func(q api.RoomserverInternalAPI) {
|
||||
var response api.QueryLatestEventsAndStateResponse
|
||||
if err := q.QueryLatestEventsAndState(
|
||||
context.Background(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue