matrix-org / matrix-rust-sdk

Matrix Client-Server SDK for Rust
Apache License 2.0
1.26k stars 252 forks source link

test(integration): Enable `test_notification` #4029

Closed Hywan closed 1 month ago

Hywan commented 1 month ago

This test was failing since the migration from the sliding sync proxy to Synapse.

This patch fixes the test. The failing part was:

assert_eq!(notification.joined_members_count, 1);

This patch removes this assertion for the moment. In Synapse 1.115, Synapse doesn't share this data for the sake of privacy because the room is not joined. But the CI runs 1.114 and it seems to be different. I'm investigating that. Edit: https://github.com/matrix-org/matrix-rust-sdk/pull/4030 fixes the CI to use 1.115, and the test now passes correctly \o/.

A comment has been made on MSC4186 to precise this behaviour: https://github.com/matrix-org/matrix-spec-proposals/pull/4186#discussion_r1774775560.

Moreover, this test was asserting a bug (which is alright), but now a bug report has been made. The patch contains the link to this bug report.. Turns out, it wasn't a bug, and a patch fixes the test.

The code has been a bit rewritten to make it simpler, and more comments have been added.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 84.23%. Comparing base (8469c64) to head (a0477fd). Report is 6 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #4029 +/- ## ========================================== + Coverage 84.14% 84.23% +0.08% ========================================== Files 266 266 Lines 28478 28478 ========================================== + Hits 23964 23989 +25 + Misses 4514 4489 -25 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.