From 994e0d432e638a16e7ce7d3082ca63564d4d719a Mon Sep 17 00:00:00 2001 From: Benjamin Pracht Date: Mon, 28 Oct 2024 13:24:58 -0700 Subject: [PATCH] Revert "Set the expected room name in ListRooms requests in the integration test (#214)" (#215) This reverts commit 1266354ea066e80c32dd214f5734570e075cae39. --- test/lktest/livekit.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/test/lktest/livekit.go b/test/lktest/livekit.go index 81155e3..47d00d3 100644 --- a/test/lktest/livekit.go +++ b/test/lktest/livekit.go @@ -64,10 +64,8 @@ type LiveKit struct { WsUrl string } -func (lk *LiveKit) ListRooms(t TB, names []string) []*livekit.Room { - resp, err := lk.Rooms.ListRooms(context.Background(), &livekit.ListRoomsRequest{ - Names: names, - }) +func (lk *LiveKit) ListRooms(t TB) []*livekit.Room { + resp, err := lk.Rooms.ListRooms(context.Background(), &livekit.ListRoomsRequest{}) if err != nil { t.Fatal(err) } @@ -433,12 +431,12 @@ wait: } } -func (lk *LiveKit) waitRooms(t TB, ctx context.Context, none bool, filter func(r *livekit.Room) bool, names []string) []*livekit.Room { +func (lk *LiveKit) waitRooms(t TB, ctx context.Context, none bool, filter func(r *livekit.Room) bool) []*livekit.Room { var rooms []*livekit.Room ticker := time.NewTicker(time.Second / 4) defer ticker.Stop() for { - rooms = lk.ListRooms(t, names) + rooms = lk.ListRooms(t) if filter != nil { var out []*livekit.Room for _, r := range rooms { @@ -469,7 +467,7 @@ func (lk *LiveKit) ExpectRoomWithParticipants(t TB, ctx context.Context, room st filter := func(r *livekit.Room) bool { return r.Name == room } - rooms := lk.waitRooms(t, ctx, len(participants) == 0, filter, []string{room}) + rooms := lk.waitRooms(t, ctx, len(participants) == 0, filter) if len(participants) == 0 && len(rooms) == 0 { return } @@ -483,7 +481,7 @@ func (lk *LiveKit) ExpectRoomPref(t TB, ctx context.Context, pref, number string filter := func(r *livekit.Room) bool { return r.Name != pref && strings.HasPrefix(r.Name, pref+"_"+number+"_") } - rooms := lk.waitRooms(t, ctx, none, filter, nil) + rooms := lk.waitRooms(t, ctx, none, filter) require.Len(t, rooms, 1) require.True(t, filter(rooms[0])) t.Log("Room:", rooms[0].Name)