-
Notifications
You must be signed in to change notification settings - Fork 216
/
justfile
222 lines (186 loc) · 6.67 KB
/
justfile
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# shellcheck shell=bash
LC_ALL := 'C.UTF-8'
default:
@just --list
# check that the code is formatted with stylish-haskell
syntax:
scripts/buildkite/main/check-code-format.sh
hlint:
nix develop --command bash -c 'hlint lib'
# build wallet
build target='all':
# shellcheck disable=SC1083
cabal build {{target}} --enable-benchmarks --enable-tests \
--minimize-conflict-set -O0 -v0 --ghc-options="-Werror "
# build after clean
clean-build:
cabal clean
just build
# run a nix shell with `cardano-wallet` in scope
wallet:
nix shell '.#cardano-wallet'
# run a benchmark: api | latency | memory | db | restore
bench target:
./.buildkite/bench-"{{target}}".sh
# run a local test cluster
local-cluster:
nix shell '.#local-cluster' '.#cardano-node' \
-c "local-cluster" \
--cluster-configs lib/local-cluster/test/data/cluster-configs \
--cluster-logs ignore-me/cluster.logs \
--socket-path ignore-me/cluster.socket \
--monitoring-port 12788
# run unit tests on a match
unit-tests-cabal-match match:
LOCAL_CLUSTER_CONFIGS=../../lib/local-cluster/test/data/cluster-configs \
cabal test \
cardano-balance-tx:test \
cardano-numeric:unit \
cardano-wallet-blackbox-benchmarks:unit \
cardano-wallet-launcher:unit \
cardano-wallet-network-layer:unit \
cardano-wallet-primitive:test \
cardano-wallet-read:test \
cardano-wallet-secrets:test \
cardano-wallet-test-utils:unit \
cardano-wallet-unit:unit \
delta-chain:unit \
delta-store:unit \
delta-table:unit \
delta-types:unit \
std-gen-seed:unit \
text-class:unit \
wai-middleware-logging:unit \
-O0 -v0 \
--test-options '--match="{{match}}"'
unit-tests-local-cluster-match match:
nix shell '.#local-cluster' 'nixpkgs#just' \
-c just unit-tests-cabal-match "{{match}}"
# run unit tests
unit-tests-cabal:
just unit-tests-cabal-match ""
# run wallet-e2e suite against the preprod network
e2e-preprod:
nix run '.#cardano-wallet-e2e' -- preprod \
-s lib/wallet-e2e/test-state/preprod \
-c lib/wallet-e2e/config/cardano-node/preprod \
-t lib/wallet-e2e/test-output/preprod
add_missing_json_goldens:
CREATE_MISSING_GOLDEN=1 just unit-tests-cabal-match "JSON"
# run wallet-e2e suite against the local test cluster
e2e-local:
nix shell \
'.#local-cluster' '.#cardano-node' '.#cardano-wallet' '.#cardano-wallet-e2e' \
-c wallet-e2e local \
-s lib/wallet-e2e/test-state/local \
-c lib/local-cluster/test/data/cluster-configs \
-t lib/wallet-e2e/test-output/local
# run wallet-e2e suite against the manually started node/wallet
e2e-manual:
nix run '.#cardano-wallet-e2e' -- manual
# run any integration test matching the given pattern via cabal
integration-tests-cabal-match match:
just integration-tests-cabal-options '--match="{{match}}"'
# run any integration test matching the given pattern via cabal
integration-tests-cabal-options options:
TESTS_TRACING_MIN_SEVERITY=Warning \
LOCAL_CLUSTER_NODE_OUTPUT_FILE=/dev/null \
LOCAL_CLUSTER_CONFIGS=../../lib/local-cluster/test/data/cluster-configs \
CARDANO_WALLET_TEST_DATA=../../lib/integration/test/data \
nix shell \
'.#local-cluster' \
-c cabal test integration -O0 -v0 \
--test-options '{{options}}'
# run babbage integration tests matching the given pattern via cabal
babbage-integration-tests-cabal-match match:
LOCAL_CLUSTER_ERA=babbage \
just integration-tests-cabal-match "{{match}}"
# run conway integration tests matching the given pattern via cabal
conway-integration-tests-cabal-match match:
LOCAL_CLUSTER_ERA=conway \
just integration-tests-cabal-match "{{match}}"
# run babbage integration tests via cabal
babbage-integration-tests-cabal:
just babbage-integration-tests-cabal-match ""
# run conway integration tests via cabal
conway-integration-tests-cabal:
just conway-integration-tests-cabal-match ""
# run any integration test matching the given pattern via nix
integration-tests match:
CARDANO_WALLET_TEST_DATA=lib/integration/test/data \
TESTS_RETRY_FAILED=1 \
nix shell \
'.#cardano-wallet' \
'.#local-cluster' \
'.#integration-exe' \
-c integration-exe -j 2 --match="{{match}}"
node:
nix shell \
--accept-flake-config \
'github:IntersectMBO/cardano-node?ref=10.1.2#cardano-node' \
'github:IntersectMBO/cardano-node?ref=10.1.2#cardano-cli'
# run babbage integration tests matching the given pattern via nix
babbage-integration-tests-match match:
LOCAL_CLUSTER_CONFIGS=lib/local-cluster/test/data/cluster-configs \
LOCAL_CLUSTER_ERA=babbage \
nix shell \
'.#cardano-node' \
'.#cardano-cli' \
--accept-flake-config \
-c just integration-tests "{{match}}"
# run conway integration tests matching the given pattern via nix
conway-integration-tests-match match:
LOCAL_CLUSTER_CONFIGS=lib/local-cluster/test/data/cluster-configs \
LOCAL_CLUSTER_ERA=conway \
nix shell \
'.#cardano-node' \
'.#cardano-cli' \
--accept-flake-config \
-c just integration-tests "{{match}}"
# run babbage integration tests via nix
babbage-integration-tests:
just babbage-integration-tests-match ""
# run conway integration tests via nix
conway-integration-tests:
just conway-integration-tests-match ""
latency-bench:
BENCHMARK_CSV_FILE=ignore-me/latency-bench.csv \
cabal run -O0 -v0 cardano-wallet-benchmarks:latency -- \
--cluster-configs lib/local-cluster/test/data/cluster-configs
test-local-cluster:
LOCAL_CLUSTER_CONFIGS=lib/local-cluster/test/data/cluster-configs \
nix shell \
'.#local-cluster' \
'.#test-local-cluster-exe' \
'.#cardano-cli' \
'.#cardano-node' \
'.#cardano-wallet' \
-c test-local-cluster-exe
api-bench:
BENCHMARK_CSV_FILE=ignore-me/api-bench.csv \
cabal run -O0 -v0 \
cardano-wallet-benchmarks:api \
-- lib/benchmarks/data/api-bench
db-bench:
BENCHMARK_CSV_FILE=ignore-me/db-bench.csv \
cabal run -O0 -v0 \
cardano-wallet-benchmarks:db \
read-blocks-bench:
BENCHMARK_CSV_FILE=ignore-me/read-blocks-bench.csv \
cabal run -O0 -v0 \
cardano-wallet-benchmarks:read-blocks
memory-bench:
mkdir -p ignore-me/memory-bench
BENCHMARK_CSV_FILE=ignore-me/memory-bench.csv \
nix shell \
'.#cardano-node' \
'.#cardano-wallet' \
'nixpkgs#jq' \
'nixpkgs#curl' \
'nixpkgs#procps' \
-c cabal run -O0 -v0 \
cardano-wallet-blackbox-benchmarks:memory -- \
--snapshot lib/wallet-benchmarks/data/membench-snapshot.tgz \
--wallet cardano-wallet \
--node cardano-node \
--work-dir ignore-me/memory-bench