Move redis container initialization to test utils#507
Move redis container initialization to test utils#507DanGould merged 2 commits intopayjoin:masterfrom
Conversation
Pull Request Test Coverage Report for Build 12958602475Details
💛 - Coveralls |
|
CI failing for MSRV due to |
|
I look at crates.io/crates/redis to see which version is msrv compliant Then I think I'd pin redis https://crates.io/crates/redis/0.23.3 with listed msrv 1.63 via Cargo-minimal.lock by |
These dependencies now live in `payjoin-test-utils`
b245253 to
cac2281
Compare
testcontainers-modules is upgraded to the highest version that supports rust 1.63.
082b4c8 to
78d51f8
Compare
|
I downgraded |
DanGould
left a comment
There was a problem hiding this comment.
I've got nits which may or may not be follow ups. This looks great. Keeps getting cleaner.
| pub struct TestServices { | ||
| cert_key: (Vec<u8>, Vec<u8>), | ||
| #[allow(dead_code)] | ||
| redis: (u16, Container<'static, Redis>), |
There was a problem hiding this comment.
Perhaps add a docstring comment /// redis is an implicit dependency of directory [on the default port] to justify the #[allow(dead_code)] or otherwise set PJ_DB_HOST explicitly from redis's port info
| } | ||
|
|
||
| // generates or gets a DER encoded localhost cert and key. | ||
| /// generates or gets a DER encoded localhost cert and key. |
There was a problem hiding this comment.
super nit to prefer imperative (i.e. "generate") verbs in docstrings.
|
re:
We can easily convert log::x to tracing::x to take advantage of tracing's additional context. There's also the tracing-log crate to have dependency log::x handled as tracing::x calls. I feel like tracing calls would be especially useful for payment processors depending on payjoin, like I thought we should take advantage of tracing's structured logs in Is it overly complex in tests? We're definitely not using it to leverage what we print in CI vs local. hard to say. @0xBEEFCAF3 @nothingmuch any comment on where we should be using structured logs |
follow up for the prior test-utils redis abstractions at #507 See: #507 (review)
follow up for the prior test-utils redis abstractions at #507 See: payjoin/rust-payjoin#507 (review)
Follow-up to #484 to move redis initialization to TestServices as well.
The first commit cleans up dev-dependencies from
payjoinandpayjoin-clinow that those dependencies are pulled in via thepayjoin-test-utilscrate.Relatedly, I noticed that we initialize a
tracingsubscriber in a every test but don't really seem to be usingtracingmuch, instead usinglog::debugin most places. Is there a reason to keep usingtracingin tests or should we just remove that dependency too and useloginstead?