-
Notifications
You must be signed in to change notification settings - Fork 168
Add support for running integration tests via cargo test #420
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
Future commits will remove the hacky integration test setup. There are still some annoying warnings present for ununsed functions when they are really used. rust-lang/rust#46379 Disambiguiate rand feature with dev dependancy https://users.rust-lang.org/t/features-and-dependencies-cannot-have-the-same-name/47746
3864ae4 to
139324a
Compare
|
|
||
| #[test] | ||
| fn tests_from_cpp() { | ||
| let cl = &setup::setup().client; |
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.
I am a little puzzled in understanding how this test could work, since once BitcoinD struct goes out of scope, the node is stopped
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.
setup returns BitcoinD. It never goes out of scope.
| [dev-dependencies] | ||
| bitcoind = {version = "0.26.1", features=["22_0"]} | ||
| actual-rand = { package = "rand", version = "0.8.4"} | ||
| bitcoin = { version = "0.28", features = ["rand"]} |
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.
since there is rand anyway, can't we use sign_schnorr_with_aux_rand and remove the feature rand so that we don't have both bitcoin and bitcoin-with-rand?
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.
Adressing in a follow-up PR.
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.
ACK 139324a
I did not read the code as carefully as Riccardo evidently did -- but on a light reading it all looks good (or at least, it all looks like it does integration testing and looks like it's confined to test-only parts of the codebase, and it succeeded on my local CI).
92050de Remove bitcoin rand feature from integration testing (sanket1729) Pull request description: Addresses [feedback ](#420 (comment)) #420 's review ACKs for top commit: apoelstra: ACK 92050de RCasatta: ACK 92050de Tree-SHA512: ad3dcc3631eb3ffd6de30d577d8a08756cbb4a2ff1670b21f4902422a2104bbfc8b161583a1ba3dd7368160e2dd51bac1d68c9332fc73a3a72d3c6b3ddcdabb4
…ration tests via cargo test 139324a641d364e6c5f5c3659d81c937da7a935c Remove integration test code (sanket1729) 90b5f10d4343c61c9c3630770bba7d6f21143406 Remove warnings (sanket1729) 967b95e2e1ff4122c44e7b5d041cbeca5e7b897d Add support for running integration tests via cargo test (sanket1729) Pull request description: There are still some annoying warnings present for unused functions when they are used. rust-lang/rust#46379 Later commits will remove the hacky integration test setup. Running `cargo test` now should also run integration tests Our testing infrastructure now takes a long time to build because we have more than 100 dependencies (transitive). But all of these are dev dependencies, so our library isn't getting bloated. Fixes #361 ACKs for top commit: apoelstra: ACK 139324a641d364e6c5f5c3659d81c937da7a935c Tree-SHA512: debf68fd0ac98cffa9c8c89964d6d1c45ee542fe17eb2fdab6295357efc06eb43a0412e6ed5d0fd7264a987989984eebb0c5b3bbf7169ecb780d31dce887cb0b
…rom integration testing 92050de167119f3d6ed4d60451e7925d11121dd4 Remove bitcoin rand feature from integration testing (sanket1729) Pull request description: Addresses [feedback ](rust-bitcoin/rust-miniscript#420 (comment)) #420 's review ACKs for top commit: apoelstra: ACK 92050de167119f3d6ed4d60451e7925d11121dd4 RCasatta: ACK 92050de167119f3d6ed4d60451e7925d11121dd4 Tree-SHA512: ad3dcc3631eb3ffd6de30d577d8a08756cbb4a2ff1670b21f4902422a2104bbfc8b161583a1ba3dd7368160e2dd51bac1d68c9332fc73a3a72d3c6b3ddcdabb4
There are still some annoying warnings present for unused functions when they are used.
rust-lang/rust#46379
Later commits will remove the hacky integration test setup.
Running
cargo testnow should also run integration testsOur testing infrastructure now takes a long time to build because we have more than 100 dependencies (transitive). But all of these are dev dependencies, so our library isn't getting bloated.
Fixes #361