-
Notifications
You must be signed in to change notification settings - Fork 390
[CI] Fixed esplora blockchain tests in CI #430
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
[CI] Fixed esplora blockchain tests in CI #430
Conversation
92c3ef4
to
36f0c4d
Compare
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.
Looks good, also checkout related tcharding#2. We should be able to test esplora with ureq and reqwest. If you can incorporate into this PR I'll close the one I did.
36f0c4d
to
b6e3cc7
Compare
Updated with suggested refactors and async changes. Rearranged the commits. Moved out |
ACK 2caa590 |
Codecov Report
@@ Coverage Diff @@
## master #430 +/- ##
==========================================
- Coverage 73.07% 72.62% -0.46%
==========================================
Files 34 34
Lines 7399 7419 +20
==========================================
- Hits 5407 5388 -19
- Misses 1992 2031 +39
Continue to review full report at Codecov.
|
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.
Thanks for looking into this. I'm glad to see the things I missed in CI being remedied, however I'm not super fond of the re-introduction of hard dependency on tokio
- seems like a step backwards to me.
- name: esplora | ||
features: test-esplora,use-esplora-reqwest | ||
- name: esplora | ||
features: test-esplora,use-esplora-ureq |
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.
This line has trailing whitespace.
run: cargo test --features test-${{ matrix.blockchain.name }} ${{ matrix.blockchain.name }}::bdk_blockchain_tests | ||
|
||
run: cargo test --no-default-features --features ${{ matrix.blockchain.features }} ${{ matrix.blockchain.name }}::bdk_blockchain_tests | ||
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.
This line has trailing whitespace.
@@ -38,6 +38,10 @@ bitcoinconsensus = { version = "0.19.0-3", optional = true } | |||
# Needed by bdk_blockchain_tests macro | |||
core-rpc = { version = "0.14", optional = true } | |||
|
|||
# Platform-specific dependencies | |||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] | |||
tokio = { version = "1", features = ["rt"] } |
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.
Please correct me if I'm wrong, but this PR re-introduces a hard dependency on tokio
just so we can test esplora-reqwest
feature, that seems like a bad choice to me. A user of bdk
that wishes to use reqwest
will always be using async
, why do we want to introduce a hard dependency on tokio
just to be able to test in a manner that the library will not be used?
The esplora-reqwest
feature can be tested coupled with either async-interface
feature or using WASM target.
@@ -106,19 +106,19 @@ impl Blockchain for EsploraBlockchain { | |||
} | |||
|
|||
fn get_tx(&self, txid: &Txid) -> Result<Option<Transaction>, Error> { | |||
Ok(self.url_client._get_tx(txid).await?) | |||
Ok(await_or_block!(self.url_client._get_tx(txid))?) |
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 do not like this usage of await_or_block
because there is no reason to use reqwest
in a blocking environment, we have ureq
for that.
All my comments are resolved by the implementation in #433, please see if you have any concerns with that approach @rajarshimaitra. Thanks. |
@tcharding @LLFourn as @rajarshimaitra noted on #433 even if this PR isn't the final solution it will unblock some other work (bitcoindevkit/bdk-cli#41 and #429). Also it's more of a roll back to how the |
Don't stop the progress on my account :) |
- Changed to local bdk-macro - Added back tokio - Update esplora-reqwest and test-esplora feature guards
- add back await_or_block! to bdk-macros - use await_or_block! in reqwest tests
- Fix esplora module level feature flag - Move esplora blockchain tests to module, to cover for both variants
9967045
to
10b53a5
Compare
Description
Fixes #431 and esplora blockchain test skips in CI
Notes to the reviewers
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingBugfixes: