-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathbootstrap.sh
executable file
·47 lines (40 loc) · 1.28 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
#!/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}
hash=$(cache_content_hash "^noir-projects/aztec-nr")
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
"ci")
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