forked from EspressoSystems/HotShot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
207 lines (150 loc) · 7.49 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
default: run_ci
set export
run_ci: lint build test
build:
cargo build --workspace --examples --bins --tests --lib --benches
build_release *ARGS:
cargo build --profile=release {{ARGS}}
example *ARGS:
cargo run --profile=release-lto --package hotshot-examples --no-default-features --example {{ARGS}}
example_fixed_leader *ARGS:
cargo run --features "fixed-leader-election" --profile=release-lto --example {{ARGS}}
example_gpuvid_leader *ARGS:
cargo run --features "fixed-leader-election, gpu-vid" --profile=release-lto --example {{ARGS}}
test *ARGS:
echo Testing {{ARGS}}
cargo test --lib --bins --tests --benches --workspace --no-fail-fast {{ARGS}} -- --test-threads=1 --nocapture --skip crypto_test
test-ci *ARGS:
echo Testing {{ARGS}}
RUST_LOG=info cargo nextest run --profile ci tests_1 --lib --bins --tests --benches --workspace --no-fail-fast {{ARGS}}
test-ci-rest *ARGS:
echo Testing {{ARGS}}
RUST_LOG=info cargo nextest run -E 'not (test(tests_1) | test(tests_2) | test(tests_3) | test(tests_4) | test(tests_5))' --profile ci --lib --bins --tests --benches --workspace --no-fail-fast {{ARGS}}
test-ci-1 *ARGS:
echo Testing {{ARGS}}
RUST_LOG=info cargo nextest run --profile ci tests_1 --lib --bins --tests --benches --workspace --no-fail-fast {{ARGS}}
test-ci-2 *ARGS:
echo Testing {{ARGS}}
RUST_LOG=info cargo nextest run --profile ci tests_2 --lib --bins --tests --benches --workspace --no-fail-fast {{ARGS}}
test-ci-3 *ARGS:
echo Testing {{ARGS}}
RUST_LOG=info cargo nextest run --profile ci tests_3 --lib --bins --tests --benches --workspace --no-fail-fast {{ARGS}}
test-ci-4 *ARGS:
echo Testing {{ARGS}}
RUST_LOG=info cargo nextest run --profile ci tests_4 --lib --bins --tests --benches --workspace --no-fail-fast {{ARGS}}
test-ci-5 *ARGS:
echo Testing {{ARGS}}
RUST_LOG=info cargo nextest run --profile ci tests_5 --lib --bins --tests --benches --workspace --no-fail-fast {{ARGS}}
test_basic: test_success test_with_failures test_network_task test_consensus_task test_da_task test_vid_task test_view_sync_task
test_catchup:
echo Testing catchup
cargo test --lib --bins --tests --benches --workspace --no-fail-fast test_catchup -- --test-threads=1 --nocapture
test_crypto:
cargo test --lib --bins --tests --benches --workspace --no-fail-fast crypto_test -- --test-threads=1 --nocapture
test_success:
echo Testing success test
cargo test --lib --bins --tests --benches --workspace --no-fail-fast test_success -- --test-threads=1 --nocapture
test_timeout:
echo Testing timeout test
cargo test --lib --bins --tests --benches --workspace --no-fail-fast test_timeout -- --test-threads=1 --nocapture
test_combined_network:
echo Testing combined network
cargo test --lib --bins --tests --benches --workspace --no-fail-fast test_combined_network -- --test-threads=1 --nocapture
test_web_server:
echo Testing web server
cargo test --lib --bins --tests --benches --workspace --no-fail-fast web_server_network -- --test-threads=1 --nocapture
test_with_failures:
echo Testing nodes leaving the network
cargo test --lib --bins --tests --benches --workspace --no-fail-fast test_with_failures -- --test-threads=1 --nocapture
test_network_task:
echo Testing the DA task
cargo test --lib --bins --tests --benches --workspace --no-fail-fast test_network_task -- --test-threads=1 --nocapture
test_memory_network:
echo Testing the DA task
cargo test --lib --bins --tests --benches --workspace --no-fail-fast memory_network -- --test-threads=1 --nocapture
test_consensus_task:
echo Testing the consensus task
cargo test --lib --bins --tests --benches --workspace --no-fail-fast test_consensus -- --test-threads=1 --nocapture
test_quorum_vote_task:
echo Testing the quorum vote task
cargo test --lib --bins --tests --benches --workspace --no-fail-fast test_quorum_vote_task -- --test-threads=1 --nocapture
test_quorum_proposal_task:
echo Testing the quorum proposal task
cargo test --lib --bins --tests --benches --workspace --no-fail-fast test_quorum_proposal_task -- --test-threads=1 --nocapture
test_da_task:
echo Testing the DA task
cargo test --lib --bins --tests --benches --workspace --no-fail-fast test_da_task -- --test-threads=1 --nocapture
test_vid_task:
echo Testing the VID task
cargo test --lib --bins --tests --benches --workspace --no-fail-fast test_vid_task -- --test-threads=1 --nocapture
test_view_sync_task:
echo Testing the view sync task
cargo test --lib --bins --tests --benches --workspace --no-fail-fast test_view_sync_task -- --test-threads=1 --nocapture
test_quorum_proposal_recv_task:
echo Testing the quorum proposal recv task
cargo test --lib --bins --tests --benches --workspace --no-fail-fast test_quorum_proposal_recv_task -- --test-threads=1 --nocapture
test_upgrade_task:
echo Testing the upgrade task
cargo test --lib --bins --tests --benches --workspace --no-fail-fast test_upgrade_task -- --test-threads=1 --nocapture
test_pkg := "hotshot"
default_test := ""
test_name := "sequencing_libp2p_test"
run_test test=default_test:
cargo test --lib --bins --tests --benches {{test}} --no-fail-fast -- --test-threads=1 --nocapture
test_pkg_all pkg=test_pkg:
cargo test --lib --bins --tests --benches --package={{pkg}} --no-fail-fast -- --test-threads=1 --nocapture
list_tests_json package=test_pkg:
RUST_LOG=none cargo test --lib --bins --tests --benches --package={{package}} --no-fail-fast -- --test-threads=1 -Zunstable-options --format json
list_examples package=test_pkg:
cargo metadata | jq '.packages[] | select(.name == "{{package}}") | .targets[] | select(.kind == ["example"] ) | .name'
check:
echo Checking
cargo check --workspace --bins --tests --examples
clippy:
echo clippy
cargo clippy --workspace --examples --bins --tests -- -D warnings
clippy_release:
echo clippy release
cargo clippy --package hotshot --no-default-features --features="docs, doc-images" -- -D warnings
fmt:
echo Running cargo fmt
cargo fmt -- crates/**/*.rs
cargo fmt -- crates/**/tests/**/**.rs
fmt_check:
echo Running cargo fmt --check
cargo fmt --check -- crates/**/*.rs
cargo fmt --check -- crates/**/tests/**/**.rs
lint: clippy fmt_check
lint_release: clippy_release fmt_check
fmt_clippy: fmt clippy
careful:
echo Careful-ing with tokio executor
cargo careful test --profile careful --lib --bins --tests --benches --workspace --no-fail-fast -- --test-threads=1 --nocapture
semver *ARGS:
#!/usr/bin/env bash
echo Running cargo-semver-checks
while IFS= read -r crate; do
cargo semver-checks \
--package "${crate}" {{ARGS}} || true;
done < <(cargo workspaces list)
fix:
cargo fix --allow-dirty --allow-staged --workspace --lib --bins --tests --benches
doc:
echo Generating docs
cargo doc --no-deps --bins --examples --lib -p 'hotshot-types'
cargo doc --no-deps --workspace --document-private-items --bins --examples --lib
doc_test:
echo Test docs
cargo test --doc --workspace
lint_imports:
echo Linting imports
cargo fmt --all -- --config unstable_features=true,imports_granularity=Crate
gen_key_pair:
echo Generating key pair from config file in config/
cargo test --package hotshot-testing --test gen_key_pair -- tests --nocapture
test_randomized_leader_election:
echo Testing
cargo test --features "randomized-leader-election" --lib --bins --tests --benches --workspace --no-fail-fast -- --test-threads=1 --nocapture --skip crypto_test
code_coverage:
echo "Running code coverage"
cargo-llvm-cov llvm-cov --lib --bins --tests --benches --release --workspace --lcov --output-path lcov.info -- --test-threads=1