-
Notifications
You must be signed in to change notification settings - Fork 260
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
test: make the EventFactory
available to all crates
#4296
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4296 +/- ##
==========================================
- Coverage 85.04% 85.03% -0.01%
==========================================
Files 274 274
Lines 30114 29977 -137
==========================================
- Hits 25610 25491 -119
+ Misses 4504 4486 -18 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
e441e75
to
83a8ad6
Compare
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.
It's an improvement, thanks. Can you rebase your history before merging please?
@@ -44,7 +44,7 @@ wasm-bindgen = "0.2.84" | |||
[dev-dependencies] | |||
assert_matches = { workspace = true } | |||
proptest = { version = "1.4.0", default-features = false, features = ["std"] } | |||
matrix-sdk-test = { workspace = true } | |||
matrix-sdk-test-macros = { path = "../../testing/matrix-sdk-test-macros" } |
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.
👍
@@ -21,7 +21,7 @@ http = { workspace = true } | |||
matrix-sdk-common = { path = "../../crates/matrix-sdk-common" } | |||
matrix-sdk-test-macros = { version = "0.7.0", path = "../matrix-sdk-test-macros" } | |||
once_cell = { workspace = true } | |||
ruma = { workspace = true, features = ["rand"] } | |||
ruma = { workspace = true, features = ["rand", "unstable-msc3381"] } |
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.
Why is it useful?
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.
Enabling support for polls when the crate is built independently. I'll add a comment.
f33e9b8
to
81b2b9b
Compare
This is more in line with what we're doing in the SDK in general.
The (matrix-sdk-)common crate used the (matrix-sdk-)test crate only to benefit from the `async_test` proc macro, which is conveniently defined in another crate. My goal is to make `EventFactory`, at this point in the commit history, defined in the main SDK crate, available in the test crate. `EventFactory` makes use of some types defined in common, so there's a circular dependency at the moment. To split this circular dependency, I've changed the common crate to depend on the test-macro crate directly; now the test crate can depend on the common crate, and everybody's happy.
81b2b9b
to
cf03eea
Compare
This makes it available to the crypto crate, by lowering it into the local dependency tree.
… evaluation requirements
cf03eea
to
85fb3b2
Compare
This had been requested by crypto folks in the past, notably @BillCarsonFr if I remember correctly: it makes the
EventFactory
available from all crates, by moving it intomatrix-sdk-test
. Because the common crate depended on the test crate, andEventFactory
depends on thecommon
crate, this required cutting the circular dependency by having the common crate use the test-macro crate directly. I find it an acceptable tradeoff.The two first commits tidy up the test utils implemented in the SDK crate. I don't think they can be moved to another external crate:
Client
,So we'd have a circular dependency there too, if we moved this code to another crate (unless I'm missing something).