Skip to content

test: Implement integration tests #289

Draft
tvpeter wants to merge 28 commits into
bitcoindevkit:masterfrom
tvpeter:test/integration-tests
Draft

test: Implement integration tests #289
tvpeter wants to merge 28 commits into
bitcoindevkit:masterfrom
tvpeter:test/integration-tests

Conversation

@tvpeter

@tvpeter tvpeter commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR builds on #278 and introduces integration tests for bdk-cli. It replaces manual std::process::Command boilerplate with the assert_cmd library, allowing us to perform black-box testing against the compiled binary.

Features covered so far include:

  • key: generate, derive, and restore
  • wallets: list wallets
  • wallet config: save config, read config.
  • descriptor: generate descriptor
  • compile: policy compiler
  • offline wallet operations: new_address, unused_address, balance, unspent, transactions, policies, public_descriptor, create_tx, combine_psbt

Notes to the reviewers

Changelog notice

  • Introduces the BdkCli helper struct to inject context state into base commands.

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

tvpeter added 27 commits June 5, 2026 13:43
- move all blockchain clients code into the
backend subdirectory
- move commands.rs content into commands
subdirectory
- split util fns into `descriptors` and `common`
- move persister into wallet subdirectory
- update imports in payjoin module
- split handlers into top level commands config,
key and descriptors
- move handler fns into offline, online, wallets
modules
- split handler fns into repl
- add entry point to the handlers subdir
- add wallet subdir entry point
- add trait for formatting outputs
- add types for presenting data to the output
- refactor offline mod to use types
- add types for descriptor, key and wallets mods
- add simple table helper fn for creating tables
- refactor types to use simple table helper
- add type defs for key, wallets and descriptors
- rebase master for bip322 feature
- update types to use simple table helper
- move wallet subdir into the persister module
to simplify the structure as wallet was confusing
- remove --pretty flag
- move types to utils
- update commands
- add run fn in main to handle routing
- move execution logic into config, desc and key
modules
- fix execution logic for subcommands under
offline and online wallet subcommands
- Define Init state for when an execution does
not need either the wallet or client for execution
- Define the Offline wallet operations state
for app context when an execution envt needs
 a wallet
- Define the online wallet operations state for
appcontext when an execution needs both the
wallet and client
- make app context generic over the state
- make the app command and async app command
generic over the execution context
- deleted shorten fn as it was applicable to the
pretty flag
- removed tests for pretty flag
- apply app context with state to all the modules
- cover case for commands when db is not required
- add wallet runtime module to serve as context
manager
- fix clippy errors
- rebase silent payment feature
- add BdkCli helper struct and impl methods
- add integration tests for the key subcommand
operations
- Add integration tests for wallets, descriptor,
compile and config modules
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.22981% with 1075 lines in your changes missing coverage. Please review.
✅ Project coverage is 27.51%. Comparing base (c579854) to head (b3ffd2d).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
src/handlers/offline.rs 27.87% 282 Missing ⚠️
src/handlers/online.rs 0.00% 213 Missing ⚠️
src/client.rs 0.00% 164 Missing ⚠️
src/utils/common.rs 46.30% 80 Missing ⚠️
src/utils/descriptors.rs 42.02% 80 Missing ⚠️
src/handlers/repl.rs 0.00% 77 Missing ⚠️
src/handlers/config.rs 54.83% 42 Missing ⚠️
src/main.rs 47.43% 41 Missing ⚠️
src/utils/types.rs 39.47% 23 Missing ⚠️
src/handlers/descriptor.rs 57.14% 21 Missing ⚠️
... and 5 more
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #289       +/-   ##
===========================================
+ Coverage   10.22%   27.51%   +17.28%     
===========================================
  Files           8       19       +11     
  Lines        2709     2497      -212     
===========================================
+ Hits          277      687      +410     
+ Misses       2432     1810      -622     
Flag Coverage Δ
rust 27.51% <33.22%> (+17.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- add integration tests for offline wallet
operations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant