Skip to content

Commit a375a47

Browse files
authored
Fix syntax benchmarks (#7539)
1 parent 38414ac commit a375a47

File tree

7 files changed

+675
-715
lines changed

7 files changed

+675
-715
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,9 @@ jobs:
364364

365365
- name: Run syntax benchmarks
366366
if: matrix.benchmarks
367-
run: ./_build/install/default/bin/syntax_benchmarks | tee tests/benchmark-output.json
367+
run: |
368+
set -o pipefail
369+
./_build/install/default/bin/syntax_benchmarks | tee tests/benchmark-output.json
368370
369371
# Benchmarking is disabled for now because of inconsistent run times on different runners
370372
#

scripts/format.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ shopt -s extglob
44

55
dune build @fmt --auto-promote
66

7-
files=$(find runtime tests -type f \( -name "*.res" -o -name "*.resi" \) ! -name "syntaxErrors*" ! -name "generated_mocha_test.res" ! -path "tests/syntax_*" ! -path "tests/analysis_tests/tests*" ! -path "*/node_modules/*")
7+
files=$(find runtime tests -type f \( -name "*.res" -o -name "*.resi" \) ! -name "syntaxErrors*" ! -name "generated_mocha_test.res" ! -path "tests/syntax_tests*" ! -path "tests/analysis_tests/tests*" ! -path "*/node_modules/*")
88
./cli/rescript.js format $files
99

1010
yarn format

scripts/format_check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ case "$(uname -s)" in
1717
fi
1818

1919
echo "Checking ReScript code formatting..."
20-
files=$(find runtime tests -type f \( -name "*.res" -o -name "*.resi" \) ! -name "syntaxErrors*" ! -name "generated_mocha_test.res" ! -path "tests/syntax_*" ! -path "tests/analysis_tests/tests*" ! -path "*/node_modules/*")
20+
files=$(find runtime tests -type f \( -name "*.res" -o -name "*.resi" \) ! -name "syntaxErrors*" ! -name "generated_mocha_test.res" ! -path "tests/syntax_tests*" ! -path "tests/analysis_tests/tests*" ! -path "*/node_modules/*")
2121
if ./cli/rescript.js format -check $files; then
2222
printf "${successGreen}✅ ReScript code formatting ok.${reset}\n"
2323
else

tests/syntax_benchmarks/Benchmark.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ end = struct
160160
let parse_rescript src filename =
161161
let p = Parser.make src filename in
162162
let structure = ResParser.parse_implementation p in
163-
assert (p.diagnostics == []);
163+
if p.diagnostics != [] then (
164+
Res_diagnostics.print_report p.diagnostics src;
165+
assert false);
164166
structure
165167

166168
let data_dir = "tests/syntax_benchmarks/data"

0 commit comments

Comments
 (0)