-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathjustfile
147 lines (110 loc) · 4.93 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
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-ci-rest *ARGS:
echo Running unit tests
RUST_LOG=error cargo nextest run -E 'not (test(tests_1) | test(tests_2) | test(tests_3) | test(tests_4) | test(tests_5) | test(tests_6))' --profile ci --lib --bins --tests --benches --workspace --no-fail-fast {{ARGS}}
test-ci-1:
echo Running integration test group 1
RUST_LOG=error cargo nextest run --profile ci tests_1 --lib --bins --tests --benches --workspace --no-fail-fast
test-ci-2:
echo Running integration test group 2
RUST_LOG=error cargo nextest run --profile ci tests_2 --lib --bins --tests --benches --workspace --no-fail-fast
test-ci-3:
echo Running integration test group 3
RUST_LOG=error cargo nextest run --profile ci tests_3 --lib --bins --tests --benches --workspace --no-fail-fast
test-ci-4:
echo Running integration test group 4
RUST_LOG=error cargo nextest run --profile ci tests_4 --lib --bins --tests --benches --workspace --no-fail-fast
test-ci-5:
echo Running integration test group 5
RUST_LOG=error cargo nextest run --profile ci tests_5 --lib --bins --tests --benches --workspace --no-fail-fast
test-ci-6-1:
echo Running integration test group 6
RUST_LOG=error cargo nextest run --profile ci tests_6 --lib --bins --tests --benches --workspace --no-fail-fast --partition hash:1/6
test-ci-6-2:
echo Running integration test group 6
RUST_LOG=error cargo nextest run --profile ci tests_6 --lib --bins --tests --benches --workspace --no-fail-fast --partition hash:2/6
test-ci-6-3:
echo Running integration test group 6
RUST_LOG=error cargo nextest run --profile ci tests_6 --lib --bins --tests --benches --workspace --no-fail-fast --partition hash:3/6
test-ci-6-4:
echo Running integration test group 6
RUST_LOG=error cargo nextest run --profile ci tests_6 --lib --bins --tests --benches --workspace --no-fail-fast --partition hash:4/6
test-ci-6-5:
echo Running integration test group 6
RUST_LOG=error cargo nextest run --profile ci tests_6 --lib --bins --tests --benches --workspace --no-fail-fast --partition hash:5/6
test-ci-6-6:
echo Running integration test group 6
RUST_LOG=error cargo nextest run --profile ci tests_6 --lib --bins --tests --benches --workspace --no-fail-fast --partition hash:6/6
# Usage:
#
# just test memoryimpl_::test_success
#
# To display logs from a test run:
#
# just test memoryimpl_::test_success --nocapture
test *ARGS:
echo Running test {{ARGS}}
cargo nextest run --profile local {{ARGS}} --lib --bins --tests --benches --workspace
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