Skip to content
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

Add support for running integration tests via cargo test #420

Merged
merged 3 commits into from
Jun 2, 2022

Conversation

sanket1729
Copy link
Member

@sanket1729 sanket1729 commented May 26, 2022

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

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

#[test]
fn tests_from_cpp() {
let cl = &setup::setup().client;
Copy link
Contributor

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

Copy link
Member Author

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"]}
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Member

@apoelstra apoelstra left a 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).

@sanket1729 sanket1729 merged commit 56207d5 into rust-bitcoin:master Jun 2, 2022
apoelstra added a commit that referenced this pull request Jun 3, 2022
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move to bitcoind crate for integration testing
3 participants