@@ -21,20 +21,56 @@ cargo build --profile=release-smaller
2121```
2222
2323### Testing
24+
25+ #### Unit tests (no external infrastructure needed)
26+ ``` bash
27+ cargo test --lib
28+ ```
29+
30+ #### Standard integration tests
31+ Uses the ` electrsd ` crate to auto-download and spawn ` bitcoind ` + ` electrs ` binaries.
32+ To use pre-downloaded binaries, set ` BITCOIND_EXE ` and ` ELECTRS_EXE ` env vars.
33+
34+ On macOS, the default file descriptor limit (256) is too low for spawning ` bitcoind ` +
35+ ` electrs ` . Raise it before running integration tests:
36+
37+ Test files: ` tests/integration_tests_rust.rs ` , ` tests/reorg_test.rs ` ,
38+ ` tests/multi_address_types_tests.rs `
39+
2440``` bash
25- # Run all tests
26- cargo test
41+ ulimit -n 10240 && cargo test
42+ ```
2743
28- # Run a specific test
44+ #### Run a specific test
45+ ``` bash
2946cargo test test_name
47+ ```
3048
31- # Run tests with specific features
49+ #### Run tests with UniFFI bindings feature
50+ ``` bash
3251cargo test --features " uniffi"
52+ ```
53+
54+ #### CLN integration tests
55+ Requires Docker and ` socat ` for RPC socket forwarding.
56+ ``` bash
57+ docker compose -f docker-compose-cln.yml up -d
58+ RUSTFLAGS=" --cfg cln_test" cargo test --test integration_tests_cln
59+ ```
3360
34- # Integration tests with specific backends
35- cargo test --cfg cln_test # Core Lightning tests
36- cargo test --cfg lnd_test # LND tests
37- cargo test --cfg vss_test # VSS (Versioned Storage Service) tests
61+ #### LND integration tests
62+ Requires Docker and CMake (>=3.5, <4.0) for ` lnd_grpc_rust ` .
63+ Set ` LND_DATA_DIR ` , ` LND_CERT_PATH ` , and ` LND_MACAROON_PATH ` env vars.
64+ ``` bash
65+ docker compose -f docker-compose-lnd.yml up -d
66+ RUSTFLAGS=" --cfg lnd_test" cargo test --test integration_tests_lnd
67+ ```
68+
69+ #### VSS integration tests
70+ Requires PostgreSQL and a running VSS server (from ` lightningdevkit/vss-server ` ).
71+ Set ` TEST_VSS_BASE_URL ` env var.
72+ ``` bash
73+ RUSTFLAGS=" --cfg vss_test" cargo test --test integration_tests_vss
3874```
3975
4076### Code Quality
@@ -200,6 +236,7 @@ marked as skipped for CI), you must fix it before declaring success.
200236- NEVER suggest manually adding @Serializable annotations to generated Kotlin bindings
201237- ALWAYS run ` cargo fmt ` before committing to ensure consistent code formatting
202238- ALWAYS move imports to the top of the file when applicable (no inline imports in functions)
239+ - ALWAYS add unit tests for new business logic — untested code will be flagged in review
203240- Run ` ./bindgen.sh ` in the background when bindings need regeneration (it is long-running)
204241
205242## Bindings Generation Command
0 commit comments