-
Notifications
You must be signed in to change notification settings - Fork 329
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
fix(testenv): disable downloads (bitcoind and electrsd) for docs.rs builds in … #1679
fix(testenv): disable downloads (bitcoind and electrsd) for docs.rs builds in … #1679
Conversation
c64de76
to
0948d24
Compare
This should conditionally remove code when the "docsrs" attribute is enables: #[cfg(not(docsrs))] To test that tests still build and run with the docsrs attribute enabled try this command:
|
|
…uilds in crate testenv
0948d24
to
a99e58e
Compare
@notmandatory edited PR desc to include: this seems like a lot, but maybe it is what we want? |
I think you're on the right track, we don't want to run any tests that use the |
@notmandatory were you saying tuesday that you don't care to include the note in the docs with |
the alternative that was mentioned is conditionally downloading the files when not running docs, like mock them out or something, but if the docs actually run the tests then that's not an option is it? |
Yes these should be removed since I don't think they do what we need. |
they are just UI additions as described here https://discord.com/channels/753336465005608961/1304476756660719668/1306644061561688107 @notmandatory |
Without having replicated the build environment used by docs.rs, my best guess is to somehow enable building [dependencies]
bdk_chain = { path = "../chain", version = "0.20.0", default-features = false }
electrsd = { version = "0.28.0", default-features = false }
[features]
default = ["std", "download"]
download = ["electrsd/bitcoind_25_0", "electrsd/esplora_a33e97e1", "electrsd/legacy"]
std = ["bdk_chain/std"]
serde = ["bdk_chain/serde"]
[package.metadata.docs.rs]
no-default-features = true |
@ValuedMammal yeah it wouldn't make sense for the tests to be run for docs, but they are being compiled, and just that requires the downloads it seems. I think you're solution might work, we may just have to try and see. We could try your solution first since it's more minimal. Do you want to make a PR for it or should I? Edit: looks like this causes tests to fail btw. I'll see if I can get them working... |
I agree with @ValuedMammal that we should be able to just disable the
I also verified that if don't disable default features and my network is disabled the docs build fails. |
@notmandatory doing this causes the same test to fail as valuedmammal's original suggestion `failures: ---- test_async_update_tx_graph_stop_gap stdout ---- Caused by: p.s i'm specifying this test bc it uses TestEnv I went ahead and made a new PR for the suggested changes just in case I'm running tests wrong locally somehow #1722 and I confirmed that the solution in this PR does not work with network off 😅 |
…for docs.rs b… 9b48fd4 fix(testenv): disable downloads (bitcoind and electrsd) for docs.rs builds of crate testenv (River Kanies) Pull request description: …uilds of crate testenv ### Description address this issue #1627 where docs.rs build is failing for bdk_testenv crate original PR: #1679 ### Notes to the reviewers I was not able to reproduce the build issue locally, so this will have to be tested live unless someone else can reproduce the build error https://docs.rs/crate/bdk_testenv/0.10.0/builds/1377651 more details in this thread on discord https://discord.com/channels/753336465005608961/1265333904324427849/1304476756660719668 #### Bugfixes: * [x] I'm linking the issue being fixed by this PR ACKs for top commit: ValuedMammal: ACK 9b48fd4 but I guess we won't know for sure until we publish the crate notmandatory: ACK 9b48fd4 Tree-SHA512: fe4ad420f71530a279e1cf86af6e7bd59f381804a5c7c9636fa2aaa5592ff4e6fed668513831d7d63ed0a97152d685b187d50e906b21dbbb2180dedf5d28fad0
…crate testenv
Description
address this issue https://github.com/orgs/bitcoindevkit/projects/14/views/1?pane=issue&itemId=81939679&issue=bitcoindevkit%7Cbdk%7C1627
where docs.rs build is failing for bdk_testenv crate
Update: to get tests to pass
RUSTFLAGS="--cfg docsrs" cargo +nightly test
I had to add ignore flags for the docs env to all three blockchain client crates (bitcoid_rpc, electrum, esplora)Notes to the reviewers
I was not able to reproduce the build issue locally, so this will have to be tested live unless someone else can reproduce the build error https://docs.rs/crate/bdk_testenv/0.10.0/builds/1377651
more details in this thread on discord https://discord.com/channels/753336465005608961/1265333904324427849/1304476756660719668
Bugfixes: