Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
161 lines (121 loc) · 5.9 KB
/
Copy pathMakefile
File metadata and controls
161 lines (121 loc) · 5.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
default: check
build:
cargo xtask build
build-wasm:
cargo xtask build --target wasm32-unknown-unknown
# This adds a make command to install a target, e.g. `make install-target-wasm32-unknown-unknown`
install-target-%:
$(CLANG_PREFIX) rustup target add $*
build-target-%: install-target-%
cargo xtask build --target $*
build-release:
cargo xtask build --release
check: fmt-check clippy-check test flutter-check
clippy-fix: cargo-clippy-fix wasm-clippy-fix
cargo-clippy-fix:
cargo xtask clippy --fix
wasm-clippy-fix:
cargo xtask wasm-clippy --fix
clippy-check: cargo-clippy-check wasm-clippy-check
cargo-clippy-check:
cargo xtask clippy
wasm-clippy-check:
cargo xtask wasm-clippy
fix: fmt-fix clippy-fix
fmt-fix:
cargo xtask fmt
fmt-check:
cargo xtask fmt --check
test: cargo-test wasm-test
cargo-test:
cargo xtask test
# The lnurl server is out of the workspace and its tests need a postgres to run
# against, so they are not part of cargo-test. LNURL_TEST_POSTGRES_URL must point
# at a disposable instance: the tests create and drop schemas in it.
lnurl-test:
cargo test --manifest-path crates/breez-sdk/lnurl/Cargo.toml
wasm-test: wasm-test-browser wasm-test-node wasm-test-mysql-timezone
wasm-test-browser:
cargo xtask wasm-test
wasm-test-node:
cargo xtask wasm-test --node
# Regression test for the JS mysql-{token,tree}-store TZ-handling bug. Runs
# the spent-marker / spent-leaf scenarios under several host TZs (positive
# and negative offsets) so the bug surfaces on any CI runner regardless of
# system clock. Depends on wasm-test-node for the upstream `npm install` of
# mysql-storage / mysql-{token,tree}-store deps that these tests reuse.
wasm-test-mysql-timezone: wasm-test-node
cd crates/breez-sdk/wasm/js/mysql-token-store && npm test
cd crates/breez-sdk/wasm/js/mysql-tree-store && npm test
flutter-check:
cargo xtask flutter-check
itest:
cargo xtask itest
spark-itest-pg:
USE_POSTGRES_BACKEND=true cargo xtask itest
spark-itest-mysql:
USE_MYSQL_BACKEND=true cargo xtask itest
# Regenerate the signing keyshares every local operator cluster is seeded with
# (crates/spark-itest/keyshares/). Run after bumping the pinned operator version
# and commit the result; see crates/spark-itest/keyshares/README.md.
capture-itest-keyshares:
cargo xtask capture-itest-keyshares
# Cross-version signer compatibility tests: links the previous SDK release
# (git tag pinned in spark-compat-itest's Cargo.toml) next to the current
# build and continues flows across versions. Requires Docker.
compat-itest:
cargo xtask compat-itest
# Behavioral scenarios driven through the Rust CLI REPL against the remote
# regtest network (see crates/breez-sdk/cli/tests/scenarios/README.md).
# Soft-skips without FAUCET_USERNAME/FAUCET_PASSWORD; lnurl scenarios also
# need Docker. Two threads to bound faucet pressure.
cli-itest:
cargo xtask test --package cli --test scenarios -- --test-threads=2
# WASM binding e2e tests: the shared CLI scenarios driven through the wasm
# CLI port, plus an npm-API smoke suite. Builds the local npm package first.
# Same gating as cli-itest. Requires Node 22. Test files run one at a time:
# parallel files would race on the faucet and the lnurl image build.
wasm-itest:
$(MAKE) -C crates/breez-sdk/bindings/examples/cli/langs/wasm setup
cd packages/wasm/itest && npm install && npm test
# Swift binding e2e tests: the shared CLI scenarios driven through the swift
# CLI port (macOS only). Same gating as cli-itest; the lnurl scenario skips
# where docker is unavailable (macOS CI runners).
swift-itest:
$(MAKE) -C crates/breez-sdk/bindings/examples/cli/langs/swift setup build
SCENARIO_CLI="$(CURDIR)/crates/breez-sdk/bindings/examples/cli/langs/swift/.build/debug/breez-cli" \
cargo xtask test --package cli --test scenarios -- --test-threads=2
# Kotlin binding e2e tests: the shared CLI scenarios driven through the
# kotlin-multiplatform CLI port's JVM target, which shares the generated
# uniffi binding surface with Android. Same gating as cli-itest.
kotlin-itest:
$(MAKE) -C crates/breez-sdk/bindings/examples/cli/langs/kotlin-multiplatform setup
cd crates/breez-sdk/bindings/examples/cli/langs/kotlin-multiplatform && ./gradlew jar -q --console=plain
SCENARIO_CLI="java -jar $(CURDIR)/crates/breez-sdk/bindings/examples/cli/langs/kotlin-multiplatform/build/libs/breez-sdk-spark-cli-1.0-SNAPSHOT.jar" \
cargo xtask test --package cli --test scenarios -- --test-threads=2
breez-itest:
cargo xtask test --package breez-sdk-itest -- --test-threads=8
breez-itest-pg-tree-store:
USE_POSTGRES_TREE_STORE=true cargo xtask test --package breez-sdk-itest -- --test-threads=8
breez-itest-mysql-tree-store:
USE_MYSQL_TREE_STORE=true cargo xtask test --package breez-sdk-itest -- --test-threads=8
# Mainnet conversion tests (token_conversion + stable_balance). Selects only
# those test binaries and runs single-threaded, since they share the one
# env-funded test wallet. They skip automatically unless MAINNET_TEST_MNEMONIC
# and BREEZ_API_KEY are set, so this is a no-op without those secrets.
breez-itest-mainnet:
cargo xtask test --package breez-sdk-itest --test mainnet_token_conversion -- --test-threads=1
cargo xtask test --package breez-sdk-itest --test mainnet_stable_balance -- --test-threads=1
cargo xtask test --package breez-sdk-itest --test mainnet_server_mode_conversion -- --test-threads=1
cargo xtask test --package breez-sdk-itest --test mainnet_cross_chain -- --test-threads=1
# Mainnet teardown: drains the deterministic Bob wallet back to the test account,
# converting tokens to sats. Run last (e.g. as an always() CI step) so funds are
# recovered even when the conversion tests fail. No-op without the secrets above.
breez-itest-mainnet-teardown:
cargo xtask test --package breez-sdk-itest --test mainnet_teardown -- --test-threads=1
claude-check:
make fmt-check clippy-check cargo-test
open-core-rustdocs:
cd crates/breez-sdk/core && cargo doc --no-deps --open
update-lockfiles:
./scripts/update-lock-files.sh