mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-07 06:53:09 -06:00
Give every test a unique room
This commit is contained in:
parent
8159603ccb
commit
d216eea879
|
|
@ -423,12 +423,6 @@ func TestRoomserverConsumerOneInvite(t *testing.T) {
|
||||||
func TestOutputAppserviceEvent(t *testing.T) {
|
func TestOutputAppserviceEvent(t *testing.T) {
|
||||||
alice := test.NewUser(t)
|
alice := test.NewUser(t)
|
||||||
bob := test.NewUser(t)
|
bob := test.NewUser(t)
|
||||||
room := test.NewRoom(t, alice)
|
|
||||||
|
|
||||||
// Invite Bob
|
|
||||||
room.CreateAndInsert(t, alice, spec.MRoomMember, map[string]interface{}{
|
|
||||||
"membership": "invite",
|
|
||||||
}, test.WithStateKey(bob.ID))
|
|
||||||
|
|
||||||
test.WithAllDatabases(t, func(t *testing.T, dbType test.DBType) {
|
test.WithAllDatabases(t, func(t *testing.T, dbType test.DBType) {
|
||||||
cfg, processCtx, closeDB := testrig.CreateConfig(t, dbType)
|
cfg, processCtx, closeDB := testrig.CreateConfig(t, dbType)
|
||||||
|
|
@ -454,6 +448,13 @@ func TestOutputAppserviceEvent(t *testing.T) {
|
||||||
clientapi.AddPublicRoutes(processCtx, routers, cfg, natsInstance, nil, rsAPI, nil, nil, nil, usrAPI, nil, nil, caching.DisableMetrics)
|
clientapi.AddPublicRoutes(processCtx, routers, cfg, natsInstance, nil, rsAPI, nil, nil, nil, usrAPI, nil, nil, caching.DisableMetrics)
|
||||||
createAccessTokens(t, accessTokens, usrAPI, processCtx.Context(), routers)
|
createAccessTokens(t, accessTokens, usrAPI, processCtx.Context(), routers)
|
||||||
|
|
||||||
|
room := test.NewRoom(t, alice)
|
||||||
|
|
||||||
|
// Invite Bob
|
||||||
|
room.CreateAndInsert(t, alice, spec.MRoomMember, map[string]interface{}{
|
||||||
|
"membership": "invite",
|
||||||
|
}, test.WithStateKey(bob.ID))
|
||||||
|
|
||||||
// create a dummy AS url, handling the events
|
// create a dummy AS url, handling the events
|
||||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
var txn consumers.ApplicationServiceTransaction
|
var txn consumers.ApplicationServiceTransaction
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue