Check independent features#567
Conversation
`cargo check --no-default-features --features v1` was producing an error because `thread_rng` was not available with the given feature set. Somehow the other feature combinations make std available. no-std randomness would be nice for web browser embed, but we should cross that bridge when we get to it by using the `getrandom` crate with `js` feature enabled. For now all of our targets can depend on `std`.
ad6d321 to
bf80cc7
Compare
Pull Request Test Coverage Report for Build 13815084700Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
9e78355 to
d2d041f
Compare
v1, directory, v2, and _multiparty ought to compile on their own and with --all-features enabled. Ensure this in CI. I chose `check` as a happy medium tradeoff between redundant tests and independent feature combination failure. I believe with careful review this CI job should catch the vast majority of potential mistakes. `--locked` cannot be used because of the many feature combinations.
Yes, the CI overhead of Actually I wonder if we should make this check a part of |
|
I see no obvious reason not to |
`payjoin/{v1,directory,v2,_multiparty}` ought to compile on their own in
addition to with --all-features enabled. `payjoin-cli/{v1,v2}` ought to
do the same. Ensure this in CI with recursive lint.sh.
`cargo clippy` replaces `cargo check` for this purpose since it doesn't
take much longer to run and it also flags issues like unused code.
|
Updated to use |
benalleng
left a comment
There was a problem hiding this comment.
tACK. Tested both from the main repo dir and observed the independent feature lints for payjoin and payjoin-cli as well tested within each crate
|
Did you leave out |
|
I did leave out |
I noticed when reviewing #558 that some intended feature combinations were broken. In particular tests didn't catch that a
v2feature gate on an error variant would break if theimpl Displayfor that variant wasn't also gated. This led me to notice thatcargo check --no-default-features --features v1was also failing because of unavailability ofthread_rng.The first commit addresses the build failure in independent
v1build, the second creates checks forpayjoin.I am curious if @spacebear21 you think such checks are also appropriate for
payjoin-cliandpayjoin-directorywho should be able to be compiled with independent feature combinations as well. I chosecheckas a happy medium tradeoff between redundant tests and independent feature combination failure. I believe with careful review this CI job should catch the vast majority of potential mistakes.close #566