rust-electrum-client icon indicating copy to clipboard operation
rust-electrum-client copied to clipboard

Fix unreproducible tests

Open storopoli opened this issue 1 year ago • 3 comments

          > The tests are CRAZY! They are even not reproducible. They pretty much ping a live server `electrum.blockstream.info:50001`. So I added the tests for the fees to make sure that the fee is `> 0`.

Maybe we should switch to use a local regtest electrs that we pre-populate with a certain amount of transactions and blocks to make them ~reproducible? Or, we could consider building a mock Electrum server, which shouldn't be hard to do? Especially given the confusion around fee rate conversion it would be good to test it properly in CI?

Originally posted by @tnull in https://github.com/bitcoindevkit/rust-electrum-client/issues/136#issuecomment-2275080407

storopoli avatar Aug 08 '24 08:08 storopoli

I do like the idea of using a local regtest electrs, by using electrsd for example.

I also think it'll be pretty much straightforward if we choose to use our bdk_testenv crate instead of trying to rebuild everything from scratch again with electrsd.

oleonardolima avatar Aug 09 '24 12:08 oleonardolima

I'll work on this, as it's better not to rely on testing on a live instance, and use a regtest environment instead.

oleonardolima avatar Feb 04 '25 03:02 oleonardolima

Use corepc-node as a dev dependency. It is in a pretty good state once it was moved to rust-bitcoin org.

storopoli avatar Feb 04 '25 10:02 storopoli