Skip to content

Commit a1b0bb2

Browse files
authored
chore: replace benchmarks on fast test suites with a cut-off (#7276)
1 parent d5d6cb7 commit a1b0bb2

File tree

2 files changed

+86
-13
lines changed

2 files changed

+86
-13
lines changed

.github/workflows/test-js-packages.yml

+10-13
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ jobs:
534534
- name: Build list of libraries
535535
id: get_critical_libraries
536536
run: |
537-
LIBRARIES=$(grep -Po "^https://github.com/\K.+" ./CRITICAL_NOIR_LIBRARIES | jq -R -s -c 'split("\n") | map(select(. != "")) | map({ repo: ., path: ""})')
537+
LIBRARIES=$(yq ./EXTERNAL_NOIR_LIBRARIES.yml -o json | jq -c '.libraries | map({ repo, path: (.path // ""), timeout:(.timeout // 2), nargo_args })')
538538
echo "libraries=$LIBRARIES"
539539
echo "libraries=$LIBRARIES" >> $GITHUB_OUTPUT
540540
env:
@@ -548,17 +548,7 @@ jobs:
548548
fail-fast: false
549549
matrix:
550550
project: ${{ fromJson( needs.critical-library-list.outputs.libraries )}}
551-
include:
552-
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/aztec-nr }
553-
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-contracts }
554-
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/blob }
555-
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/parity-lib }
556-
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-lib }
557-
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/reset-kernel-lib }
558-
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/types }
559-
# Use 1 test threads for rollup-lib because each test requires a lot of memory, and multiple ones in parallel exceed the maximum memory limit.
560-
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-lib, nargo_args: "--test-threads 1" }
561-
551+
562552
name: Check external repo - ${{ matrix.project.repo }}/${{ matrix.project.path }}
563553
steps:
564554
- name: Checkout
@@ -604,6 +594,12 @@ jobs:
604594
nargo test --silence-warnings --skip-brillig-constraints-check --format json ${{ matrix.project.nargo_args }} | tee $output_file
605595
TIME=$(($SECONDS-$BEFORE))
606596
597+
if [ "TIME" -gt "${{ matrix.project.timeout }}" ]; then
598+
# Library testing time has regressed past the set timeout.
599+
# Don't bump this timeout without understanding why this has happened and confirming that you're not the cause.
600+
exit 1
601+
fi
602+
607603
NAME=${{ matrix.project.repo }}/${{ matrix.project.path }}
608604
# Replace any slashes with underscores
609605
NAME=${NAME//\//_}
@@ -618,12 +614,13 @@ jobs:
618614
fi
619615
env:
620616
NARGO_IGNORE_TEST_FAILURES_FROM_FOREIGN_CALLS: true
621-
617+
622618
- name: Compare test results
623619
working-directory: ./noir-repo
624620
run: .github/scripts/check_test_results.sh .github/critical_libraries_status/${{ matrix.project.repo }}/${{ matrix.project.path }}.failures.jsonl .github/critical_libraries_status/${{ matrix.project.repo }}/${{ matrix.project.path }}.actual.jsonl
625621

626622
- name: Upload test report
623+
if: ${{ matrix.project.timeout > 10 }} # We want to avoid recording benchmarking for a ton of tiny libraries, these should be covered with aggressive timeouts
627624
uses: actions/upload-artifact@v4
628625
with:
629626
name: ${{ steps.test_report.outputs.test_report_name }}

EXTERNAL_NOIR_LIBRARIES.yml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
2+
libraries:
3+
noir_check_shuffle:
4+
repo: noir-lang/noir_check_shuffle
5+
timeout: 2
6+
ec:
7+
repo: noir-lang/ec
8+
timeout: 2
9+
eddsa:
10+
repo: noir-lang/eddsa
11+
timeout: 2
12+
mimc:
13+
repo: noir-lang/mimc
14+
timeout: 2
15+
schnorr:
16+
repo: noir-lang/schnorr
17+
timeout: 2
18+
noir_sort:
19+
repo: noir-lang/noir_sort
20+
timeout: 2
21+
noir-edwards:
22+
repo: noir-lang/noir-edwards
23+
timeout: 2
24+
noir-bignum:
25+
repo: noir-lang/noir-bignum
26+
noir_bigcurve:
27+
repo: noir-lang/noir_bigcurve
28+
noir_base64:
29+
repo: noir-lang/noir_base64
30+
timeout: 2
31+
noir_string_search:
32+
repo: noir-lang/noir_string_search
33+
timeout: 2
34+
sparse_array:
35+
repo: noir-lang/sparse_array
36+
timeout: 2
37+
noir_rsa:
38+
repo: noir-lang/noir_rsa
39+
timeout: 2
40+
noir_json_parser:
41+
repo: noir-lang/noir_json_parser
42+
timeout: 10
43+
aztec_nr:
44+
repo: AztecProtocol/aztec-packages
45+
path: noir-projects/aztec-nr
46+
timeout: 60
47+
noir_contracts:
48+
repo: AztecProtocol/aztec-packages
49+
path: noir-projects/noir-contracts
50+
timeout: 60
51+
blob:
52+
repo: AztecProtocol/aztec-packages
53+
path: noir-projects/noir-protocol-circuits/crates/blob
54+
timeout: 70
55+
protocol_circuits_parity_lib:
56+
repo: AztecProtocol/aztec-packages
57+
path: noir-projects/noir-protocol-circuits/crates/parity-lib
58+
timeout: 4
59+
protocol_circuits_private_kernel_lib:
60+
repo: AztecProtocol/aztec-packages
61+
path: noir-projects/noir-protocol-circuits/crates/private-kernel-lib
62+
timeout: 250
63+
protocol_circuits_reset_kernel_lib:
64+
repo: AztecProtocol/aztec-packages
65+
path: noir-projects/noir-protocol-circuits/crates/reset-kernel-lib
66+
timeout: 15
67+
protocol_circuits_types:
68+
repo: AztecProtocol/aztec-packages
69+
path: noir-projects/noir-protocol-circuits/crates/types
70+
timeout: 60
71+
protocol_circuits_rollup_lib:
72+
repo: AztecProtocol/aztec-packages
73+
path: noir-projects/noir-protocol-circuits/crates/rollup-lib
74+
timeout: 300
75+
# Use 1 test threads for rollup-lib because each test requires a lot of memory, and multiple ones in parallel exceed the maximum memory limit.
76+
nargo_args: "--test-threads 1"

0 commit comments

Comments
 (0)