forked from fedimint/fedimint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile.fedimint.just
113 lines (92 loc) · 4.4 KB
/
justfile.fedimint.just
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
# workaround: https://github.com/casey/just/issues/1669
[private]
default-fedi:
just default
# check if ulimit is set correctly
check-ulimit:
#!/usr/bin/env bash
if [ "$(ulimit -Sn)" -lt "1024" ]; then
>&2 echo "⚠️ ulimit too small. Run 'ulimit -Sn 1024' to avoid problems running tests"
fi
# run tests against real services (like bitcoind)
test-real: check-ulimit
./scripts/tests/rust-tests.sh
# run all tests in parallel like CI would
test-ci-all:
./scripts/tests/test-ci-all.sh
# show number of tests per package
test-count:
./scripts/tests/test-cov.sh
test-compatibility *VERSIONS:
./scripts/tests/backwards-compatibility-test.sh {{VERSIONS}}
# `cargo udeps` check
udeps:
nix build -L .#debug.workspaceCargoUdeps
# run all checks recommended before opening a PR
final-check: lint
# can't use nextest due to: https://github.com/nextest-rs/nextest/issues/16
cargo test --doc
just check-wasm
just test
check-wasm:
nix develop .#crossWasm -c cargo check --target wasm32-unknown-unknown --package fedimint-client
# regenerate server db migration snapshots
# ex: `just snapshot-server-db-migrations fedimint-server`
# ex: `just snapshot-server-db-migrations fedimint-mint-tests`
# ex: `just snapshot-server-db-migrations fedimint-ln-tests`
# ex: `just snapshot-server-db-migrations fedimint-wallet-tests`
# ex: `just snapshot-server-db-migrations fedimint-dummy-tests`
snapshot-server-db-migrations PACKAGE *EXTRA_ARGS:
env FM_PREPARE_DB_MIGRATION_SNAPSHOTS=force cargo nextest run --workspace --all-targets ${CARGO_PROFILE:+--profile ${CARGO_PROFILE}} -E 'package({{PACKAGE}})' snapshot_server_db_migrations {{EXTRA_ARGS}}
just test-server-db-migrations {{PACKAGE}} {{EXTRA_ARGS}}
test-server-db-migrations PACKAGE *EXTRA_ARGS:
env FM_PREPARE_DB_MIGRATION_SNAPSHOTS=force cargo nextest run --workspace --all-targets ${CARGO_PROFILE:+--profile ${CARGO_PROFILE}} -E 'package({{PACKAGE}})' test_server_db_migrations {{EXTRA_ARGS}}
# regenerate client db migration snapshots
# ex: `just snapshot-client-db-migrations fedimint-dummy-tests`
# ex: `just snapshot-client-db-migrations fedimint-mint-tests`
# ex: `just snapshot-client-db-migrations fedimint-ln-tests`
# ex: `just snapshot-client-db-migrations fedimint-wallet-tests`
snapshot-client-db-migrations PACKAGE *EXTRA_ARGS:
env FM_PREPARE_DB_MIGRATION_SNAPSHOTS=force cargo nextest run --workspace --all-targets ${CARGO_PROFILE:+--profile ${CARGO_PROFILE}} -E 'package({{PACKAGE}})' snapshot_client_db_migrations {{EXTRA_ARGS}}
just test-client-db-migrations {{PACKAGE}} {{EXTRA_ARGS}}
test-client-db-migrations PACKAGE *EXTRA_ARGS:
env FM_PREPARE_DB_MIGRATION_SNAPSHOTS=force cargo nextest run --workspace --all-targets ${CARGO_PROFILE:+--profile ${CARGO_PROFILE}} -E 'package({{PACKAGE}})' test_client_db_migrations {{EXTRA_ARGS}}
test-db-migrations:
just test-client-db-migrations fedimint-dummy-tests
just test-client-db-migrations fedimint-mint-tests
just test-client-db-migrations fedimint-ln-tests
just test-client-db-migrations fedimint-wallet-tests
just test-server-db-migrations fedimint-dummy-tests
just test-server-db-migrations fedimint-mint-tests
just test-server-db-migrations fedimint-ln-tests
just test-server-db-migrations fedimint-wallet-tests
just test-server-db-migrations fedimint-server
snapshot-db-migrations:
just snapshot-client-db-migrations fedimint-dummy-tests
just snapshot-client-db-migrations fedimint-mint-tests
just snapshot-client-db-migrations fedimint-ln-tests
just snapshot-client-db-migrations fedimint-wallet-tests
just snapshot-server-db-migrations fedimint-dummy-tests
just snapshot-server-db-migrations fedimint-mint-tests
just snapshot-server-db-migrations fedimint-ln-tests
just snapshot-server-db-migrations fedimint-wallet-tests
just snapshot-server-db-migrations fedimint-server
just test-db-migrations
# start mprocs with a dev federation setup. Default: 4 nodes, add `-n 1` argument to start only 1 node
mprocs *PARAMS:
./scripts/dev/mprocs/run.sh {{PARAMS}}
# exit mprocs session
exit-mprocs:
mprocs --ctl '{c: quit}' --server 127.0.0.1:4050
# start tmuxinator with dev federation setup
tmuxinator:
./scripts/dev/tmuxinator/run.sh
# exit tmuxinator session
exit-tmuxinator:
tmux kill-session -t fedimint-dev
# backport a PR
backport-pr pr:
nix shell nixpkgs#nodejs -c npx backport --pr-filter {{pr}}
# sign a release (git tag)
sign-release tag:
./scripts/release/sign.sh {{tag}}