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 22, 2024
1 parent 90c35b6 commit 289e2ac
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!("Skipping the room summary test, because the server may not support it.");
return;
}
}
panic!("{err}");
}
};

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

Expand Down

0 comments on commit 289e2ac

Please sign in to comment.