Skip to content

test: Implement integration tests #289

Open
tvpeter wants to merge 30 commits into
bitcoindevkit:masterfrom
tvpeter:test/integration-tests
Open

test: Implement integration tests #289
tvpeter wants to merge 30 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 25 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
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 44.32799% with 903 lines in your changes missing coverage. Please review.
✅ Project coverage is 34.71%. Comparing base (c579854) to head (0329928).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
src/handlers/offline.rs 34.27% 257 Missing ⚠️
src/client.rs 12.80% 143 Missing ⚠️
src/handlers/online.rs 34.74% 139 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/main.rs 61.25% 31 Missing ⚠️
src/handlers/config.rs 67.74% 30 Missing ⚠️
src/handlers/descriptor.rs 57.14% 21 Missing ⚠️
src/utils/types.rs 68.42% 12 Missing ⚠️
... and 4 more
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #289       +/-   ##
===========================================
+ Coverage   10.22%   34.71%   +24.48%     
===========================================
  Files           8       19       +11     
  Lines        2709     2509      -200     
===========================================
+ Hits          277      871      +594     
+ Misses       2432     1638      -794     
Flag Coverage Δ
rust 34.71% <44.32%> (+24.48%) ⬆️

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.

tvpeter added 3 commits June 22, 2026 22:46
- Add new address, unused address and createtx
commands to list of commands that require
loading existing db
- adding persisting changes in offline and online
commands
- 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
tvpeter added 2 commits June 22, 2026 22:49
- add integration tests for offline wallet
operations
- Add test for creating, signing, broadcasting tx
@tvpeter tvpeter force-pushed the test/integration-tests branch from b3ffd2d to 0329928 Compare June 22, 2026 21:53
@tvpeter tvpeter marked this pull request as ready for review June 22, 2026 21:56
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