Skip to content

Unskip dendrite skipif on a members presence test #516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 19, 2023
21 changes: 12 additions & 9 deletions tests/csapi/rooms_members_local_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ import (
)

func TestMembersLocal(t *testing.T) {
deployment := Deploy(t, b.BlueprintOneToOneRoom)
deployment := Deploy(t, b.BlueprintAlice)
defer deployment.Destroy(t)

alice := deployment.Client(t, "hs1", "@alice:hs1")
bob := deployment.Client(t, "hs1", "@bob:hs1")
// Here we don't use the BlueprintOneToOneRoom because else Bob would be able to see Alice's presence changes through
// that pre-existing one-on-one DM room. So we exclude that here.
bob := deployment.RegisterUser(t, "hs1", "bob", "bobspassword", false)
roomID := alice.CreateRoom(t, map[string]interface{}{"preset": "public_chat"})

bob.MustDoFunc(
Expand All @@ -23,7 +25,7 @@ func TestMembersLocal(t *testing.T) {
}),
)

_, incrementalSyncToken := alice.MustSync(t, client.SyncReq{})
_, incrementalSyncTokenBeforeBobJoinsRoom := alice.MustSync(t, client.SyncReq{TimeoutMillis: "0"})
bob.JoinRoom(t, roomID, []string{})

t.Run("Parallel", func(t *testing.T) {
Expand All @@ -38,15 +40,17 @@ func TestMembersLocal(t *testing.T) {
t.Run("Existing members see new members' join events", func(t *testing.T) {
t.Parallel()
// SyncJoinedTo already checks everything we need to know
alice.MustSyncUntil(t, client.SyncReq{}, client.SyncJoinedTo(bob.UserID, roomID))
alice.MustSyncUntil(t, client.SyncReq{Since: incrementalSyncTokenBeforeBobJoinsRoom}, client.SyncJoinedTo(bob.UserID, roomID))
})

// sytest: Existing members see new members' presence
// Split into initial and incremental sync cases in Complement.
t.Run("Existing members see new members' presence in initial sync", func(t *testing.T) {
runtime.SkipIf(t, runtime.Dendrite) // FIXME: https://github.com/matrix-org/dendrite/issues/2803
t.Run("Existing members see new members' presence (in initial sync)", func(t *testing.T) {
runtime.SkipIf(t, runtime.Dendrite) // FIXME: https://github.com/matrix-org/matrix-spec/issues/1374
t.Parallel()
// First we sync to make sure bob to have joined the room...
alice.MustSyncUntil(t, client.SyncReq{}, client.SyncJoinedTo(bob.UserID, roomID))
// ...and then we do another initial sync - this time waiting for bob's presence - to confirm we can get that.
alice.MustSyncUntil(t, client.SyncReq{},
client.SyncJoinedTo(bob.UserID, roomID),
client.SyncPresenceHas(bob.UserID, nil),
Expand All @@ -55,10 +59,9 @@ func TestMembersLocal(t *testing.T) {

// sytest: Existing members see new members' presence
// Split into initial and incremental sync cases in Complement.
t.Run("Existing members see new members' presence in incremental sync", func(t *testing.T) {
runtime.SkipIf(t, runtime.Dendrite) // FIXME: https://github.com/matrix-org/dendrite/issues/2803
t.Run("Existing members see new members' presence (in incremental sync)", func(t *testing.T) {
t.Parallel()
alice.MustSyncUntil(t, client.SyncReq{Since: incrementalSyncToken},
alice.MustSyncUntil(t, client.SyncReq{Since: incrementalSyncTokenBeforeBobJoinsRoom},
client.SyncJoinedTo(bob.UserID, roomID),
client.SyncPresenceHas(bob.UserID, nil),
)
Expand Down