-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathbootstrap.sh
executable file
·59 lines (51 loc) · 1.66 KB
/
bootstrap.sh
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
#!/usr/bin/env bash
source $(git rev-parse --show-toplevel)/ci3/source_bootstrap
cmd=${1:-}
export RAYON_NUM_THREADS=${RAYON_NUM_THREADS:-16}
export HARDWARE_CONCURRENCY=${HARDWARE_CONCURRENCY:-16}
export NARGO=${NARGO:-../../noir/noir-repo/target/release/nargo}
export NOIR_HASH=${NOIR_HASH:- $(../../noir/bootstrap.sh hash)}
hash=$(hash_str "$NOIR_HASH" $(cache_content_hash "^noir-projects/aztec-nr"))
function build {
# Being a library, aztec-nr does not technically need to be built. But we can still run nargo check to find any type
# errors and prevent warnings
echo_stderr "Checking aztec-nr for warnings..."
$NARGO check --deny-warnings
}
function test_cmds {
i=0
$NARGO test --list-tests --silence-warnings | sort | while read -r package test; do
# We assume there are 8 txe's running.
port=$((45730 + (i++ % ${NUM_TXES:-1})))
echo "$hash noir-projects/scripts/run_test.sh aztec-nr $package $test $port"
done
}
function test {
# Start txe server.
trap 'kill $(jobs -p)' EXIT
(cd $root/yarn-project/txe && LOG_LEVEL=error TXE_PORT=45730 yarn start) &
echo "Waiting for TXE to start..."
while ! nc -z 127.0.0.1 45730 &>/dev/null; do sleep 1; done
export NARGO_FOREIGN_CALL_TIMEOUT=300000
test_cmds | filter_test_cmds | parallelise
# Run the macro compilation failure tests
./macro_compilation_failure_tests/assert_macro_compilation_failure.sh
}
case "$cmd" in
""|"fast"|"full")
build
;;
"ci")
build
test
;;
test|test_cmds)
$cmd
;;
"test-macro-compilation-failure")
./macro_compilation_failure_tests/assert_macro_compilation_failure.sh
;;
*)
echo_stderr "Unknown command: $cmd"
exit 1
esac