-
Notifications
You must be signed in to change notification settings - Fork 315
refactor(sdk): Convert some tests to the MatrixMockServer and MockClientBuilder APIs #5351
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
Conversation
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #5351 +/- ##
==========================================
- Coverage 88.76% 88.73% -0.03%
==========================================
Files 333 333
Lines 90326 90381 +55
Branches 90326 90381 +55
==========================================
+ Hits 80177 80204 +27
- Misses 6325 6352 +27
- Partials 3824 3825 +1 ☔ View full report in Codecov by Sentry. |
Usually tests that don't construct it via MockMatrixServer don't care about the homeserver URL, so this allows to provide a default URL for them. Also we don't force to allocate a string when the inner API actually uses a borrowed string. Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Since there are several places that use it. Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
…f MockClientBuilder Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
…ilder Because it's such a nicer API! Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
…Builder Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
…Builder Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reeaaaaaallly nice, thanks!
There are a handful of commits to improve the APIs first, and then all the tests from
crates/matrix-sdk/src/client/mod.rs
,crates/matrix-sdk/src/sliding_sync/client.rs
andcrates/matrix-sdk/tests/integration/media.rs
are converted to those APIs.Note that those 3 files were not chosen randomly, some of the tests there fail in #5337, and one of the simplest solutions for fixing them involves porting them to the newer APIs.
This can be reviewed commit by commit.