Skip to content

Add end-to-end test framework#128

Merged
tnull merged 3 commits intolightningdevkit:mainfrom
benthecarman:e2e-tests
Feb 24, 2026
Merged

Add end-to-end test framework#128
tnull merged 3 commits intolightningdevkit:mainfrom
benthecarman:e2e-tests

Conversation

@benthecarman
Copy link
Collaborator

Closes #113

Introduces an e2e-tests crate that spins up real bitcoind and ldk-server processes to test the cli -> ldk-server flow. A build.rs automatically compiles ldk-server (with events-rabbitmq) and ldk-server-cli into a separate target directory, so tests work without manual pre-building.

Tests cover all cli commands and most rabbitmq events.

Claude helped with some of the boilerplate code

Found a small place we can make the bolt12 cli better

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Feb 19, 2026

I've assigned @valentinewallace as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.


impl TestBitcoind {
pub fn new() -> Self {
let bitcoind = Node::from_downloaded().unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we enable caching like we do in LDK/LDK Node so we don't needlessly hammer bitcoincore.org with every CI job?

},
#[command(about = "Return a BOLT12 offer for receiving payments")]
Bolt12Receive {
#[arg(help = "Description to attach along with the offer")]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this moved?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something I noticed making the bolt12 test, we can't create an amountless bolt12 because the description is required but the amount is optional. I'll move to a separate commit to make it cleaner

edition = "2021"

[dependencies]
corepc-node = { version = "0.10", features = ["download", "29_0"] }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to drop the download feature now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In CI we have set BITCOIND_SKIP_DOWNLOAD so it'll skip the download but we can keep this so it'll still download locally if you don't have it

https://github.com/rust-bitcoin/corepc/blob/master/node/build.rs#L78

@benthecarman benthecarman force-pushed the e2e-tests branch 2 times, most recently from ebf74ad to 397c4c5 Compare February 20, 2026 18:17
Since the amount was optional and the description was required, we were
unable to create an amountless bolt12 because the description was first
in the positional agruments.
@benthecarman
Copy link
Collaborator Author

Got LSPS2 functionality and the forwarded payments tested now too!

tnull
tnull previously approved these changes Feb 23, 2026
@tnull
Copy link
Collaborator

tnull commented Feb 23, 2026

Ah, seems CI is unhappy right now.

Introduces an e2e-tests crate that spins up real bitcoind and ldk-server
processes to test the cli -> ldk-server flow. A build.rs automatically compiles
ldk-server (with events-rabbitmq) and ldk-server-cli into a separate
target directory, so tests work without manual pre-building.

Tests cover all cli commands and rabbitmq events.

Claude helped with some of the boilerplate code
@benthecarman
Copy link
Collaborator Author

working on more tests for here, but can always do as a follow up if we want to merge now

@tnull tnull merged commit 57f9170 into lightningdevkit:main Feb 24, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

End-to-end testing for ldk-server

3 participants