Skip to content

Commit

Permalink
test: silently skip the room summary test on CI, if the server doesn'…
Browse files Browse the repository at this point in the history
…t support it
  • Loading branch information
bnjbvr committed Apr 18, 2024
1 parent d60802d commit f06855c
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,19 @@ async fn get_room_preview_with_room_summary(
public_no_history_room_id: &RoomId,
) {
// Alice has joined the room, so they get the full details.
let preview = RoomPreview::from_room_summary(alice, room_id).await.unwrap();
let preview = match RoomPreview::from_room_summary(alice, room_id).await {
Ok(r) => r,
Err(err) => {
if let Some(client_api_error) = err.as_client_api_error() {
if client_api_error.status_code == 404 {
warn!("Disabling the room summary test, because the server may or may not be supporting it.");
return;
}
}
panic!("{err}");
}
};

assert_room_preview(&preview, room_alias);
assert_eq!(preview.state, Some(RoomState::Joined));

Expand Down

0 comments on commit f06855c

Please sign in to comment.