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

test: consolidate esplora blocking and async test code #1113

Open
Tracked by #76
notmandatory opened this issue Sep 6, 2023 · 9 comments
Open
Tracked by #76

test: consolidate esplora blocking and async test code #1113

notmandatory opened this issue Sep 6, 2023 · 9 comments
Labels

Comments

@notmandatory
Copy link
Member

notmandatory commented Sep 6, 2023

There should be a way to consolidate blocking and async tests and TestEnv (probably with macros as Alekos originally did).

Originally posted by @notmandatory in #1110 (comment)

@notmandatory notmandatory added this to BDK Sep 6, 2023
@notmandatory notmandatory moved this to Todo in BDK Sep 6, 2023
@notmandatory notmandatory added this to the 1.0.0-alpha.3 milestone Sep 6, 2023
@vladimirfomene
Copy link
Contributor

@notmandatory do you think this can be labelled as a good first issue?

@ikeogu
Copy link

ikeogu commented Mar 5, 2024

Good day team, can I contribute to this? Although I will need some briefing .

@notmandatory
Copy link
Member Author

@ikeogu yes feel free to work on this, but first look over the code and post here or ask on discord if you have any questions before you get started.

@srikanth-iyengar
Copy link

srikanth-iyengar commented Mar 20, 2024

@notmandatory I would like to contribute to this issue
Correct me if I am wrong,
Currently we have two separate tests for each blocking and async, and as you mention it is possible to have common tests covering both blocking and async ones

@notmandatory
Copy link
Member Author

@srikanth-iyengar I think we need to figure out #1375 first, however that gets solved we should be able to use the same approach for this issue. What are your thoughts regarding the best way to consolidate async and blocking rust code?

@srikanth-iyengar
Copy link

I was thinking of something like

#[test_sync_async()]
fn test_both_sync_async() {
    let some_value = some_macro!( // this macro will decide which one to pick async or blocking 
         async { async_function().await },
        || sync_function()
    );
}

Will this be possible ? or we should go with synca

@oleonardolima
Copy link
Contributor

@notmandatory As #1375 has been closed, do you still see the need for this one?

@ValuedMammal
Copy link
Contributor

Not sure if this is the right issue to discuss it but I wanted to mention that test_finalize_chain_update takes a long time to complete (~56 seconds on my machine to run both blocking and async versions). I think it should be rewritten perhaps by consolidating the test cases, mining fewer blocks, and making less calls to esplora

@oleonardolima
Copy link
Contributor

Not sure if this is the right issue to discuss it but I wanted to mention that test_finalize_chain_update takes a long time to complete (~56 seconds on my machine to run both blocking and async versions).

Oh, that's a lot. Thanks for bringing that up, I wasn't aware of it.

I think it should be rewritten perhaps by consolidating the test cases, mining fewer blocks, and making less calls to esplora

I think your suggestions are suitable, but regarding consolidating I guess we would still need something like synca.

@notmandatory notmandatory removed the good first issue Good for newcomers label Nov 15, 2024
@notmandatory notmandatory removed this from the 1.0.0-beta milestone Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

7 participants