1
- set export
2
-
3
1
export RUSTDOCFLAGS := ' -D warnings'
4
2
5
- LOG_LEVELS := " RUST_LOG=timeboost=debug,sailfish=debug,cliquenet=debug,tests=debug"
6
-
7
- run_as_root := if env (" CI" , " false" ) == " true" { " sudo" } else { " run0" }
3
+ log_levels := " RUST_LOG=timeboost=debug,sailfish=debug,cliquenet=debug,tests=debug"
4
+ run_as_root := if env (" CI" , " " ) == " true" { " sudo" } else { " run0" }
8
5
9
6
####################
10
7
###BUILD COMMANDS###
@@ -156,10 +153,10 @@ test-contracts: build-contracts
156
153
forge test
157
154
158
155
test_ci * ARGS : build-port-alloc
159
- env {{ LOG_LEVELS }} NO_COLOR=1 target/ release/ run \
156
+ env {{ log_levels }} NO_COLOR=1 target/ release/ run \
160
157
- -spawn target/ release/ port-alloc \
161
158
cargo nextest run -- --workspace {{ ARGS}}
162
- env {{ LOG_LEVELS }} NO_COLOR=1 cargo test --doc {{ ARGS}}
159
+ env {{ log_levels }} NO_COLOR=1 cargo test --doc {{ ARGS}}
163
160
164
161
test-individually : build-port-alloc
165
162
@ for pkg in $(cargo metadata --no-deps --format-version 1 | jq -r ' .packages[].name' ); do \
@@ -185,30 +182,43 @@ test-all: build_release build-test-utils
185
182
- -spawn " 5:target/release/run-committee -c test-configs/local/ -t target/release/timeboost" \
186
183
target/ release/ block-checker -- -c test-configs/ local -b 1000
187
184
185
+ [linux ]
188
186
forward-ipv4 val : build-test-utils
189
187
{{ run_as_root}} target/ release/ net-setup system --forward-ipv4 {{ val}}
190
188
189
+ [linux ]
191
190
create-net : build-test-utils
192
191
{{ run_as_root}} target/ release/ net-setup create -c test-configs/ linux/ net.toml
193
192
193
+ [linux ]
194
194
delete-net : build-test-utils
195
195
{{ run_as_root}} target/ release/ net-setup delete -c test-configs/ linux/ net.toml
196
196
197
+ [linux ]
197
198
netsim : build_release build-test-utils
198
- env RUST_LOG=timeboost_builder::submit=debug,block_checker=info,warn \
199
- {{ run_as_root}} --setenv=PATH --setenv=HOME --setenv=RUST_LOG target/ release/ run \
200
- - -verbose \
201
- - -timeout 120 \
202
- - -clear-env \
203
- - -env PATH \
204
- - -env HOME \
205
- - -env RUST_LOG \
206
- - -uid ` id -u ` \
207
- - -gid ` id -g ` \
208
- - -spawn " 1:anvil --host 10.0.1.0 --port 8545" \
209
- - -run " 2:sleep 3" \
210
- - -run " 3:scripts/deploy-test-contract test-configs/linux/committee.toml http://10.0.1.0:8545" \
211
- - -spawn " 4:target/release/block-maker --bind 10.0.1.0:55000 -c test-configs/linux/committee.toml" \
212
- - -spawn " 4:target/release/yapper -c test-configs/linux/committee.toml" \
213
- - -spawn-as-root " 5:target/release/run-committee -u `id -u` -g `id -g` -c test-configs/linux/ -t target/release/timeboost" \
214
- target/ release/ block-checker -- -c test-configs/ linux -b 200
199
+ #!/usr/bin/env bash
200
+ set -eo pipefail
201
+ function run_as_root {
202
+ if [ " $CI" == " true" ]; then
203
+ sudo " $@"
204
+ else
205
+ run0 --setenv=PATH --setenv=HOME --setenv=RUST_LOG " $@"
206
+ fi
207
+ }
208
+ export RUST_LOG=timeboost_builder::submit=debug,block_checker=info,warn
209
+ run_as_root target/ release/ run \
210
+ - -verbose \
211
+ - -timeout 120 \
212
+ - -clear-env \
213
+ - -env PATH \
214
+ - -env HOME \
215
+ - -env RUST_LOG \
216
+ - -uid $(id -u) \
217
+ - -gid $(id -g) \
218
+ - -spawn " 1:anvil --host 10.0.1.0 --port 8545" \
219
+ - -run " 2:sleep 3" \
220
+ - -run " 3:scripts/deploy-test-contract test-configs/linux/committee.toml http://10.0.1.0:8545" \
221
+ - -spawn " 4:target/release/block-maker --bind 10.0.1.0:55000 -c test-configs/linux/committee.toml" \
222
+ - -spawn " 4:target/release/yapper -c test-configs/linux/committee.toml" \
223
+ - -spawn-as-root " 5:target/release/run-committee -u $(id -u) -g $(id -g) -c test-configs/linux/ -t target/release/timeboost" \
224
+ target/ release/ block-checker -- -c test-configs/ linux -b 200
0 commit comments