Skip to content

Fix syntax benchmarks #7539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,9 @@ jobs:

- name: Run syntax benchmarks
if: matrix.benchmarks
run: ./_build/install/default/bin/syntax_benchmarks | tee tests/benchmark-output.json
run: |
set -o pipefail
./_build/install/default/bin/syntax_benchmarks | tee tests/benchmark-output.json

# Benchmarking is disabled for now because of inconsistent run times on different runners
#
Expand Down
2 changes: 1 addition & 1 deletion scripts/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ shopt -s extglob

dune build @fmt --auto-promote

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/*")
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/*")
./cli/rescript.js format $files

yarn format
2 changes: 1 addition & 1 deletion scripts/format_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ case "$(uname -s)" in
fi

echo "Checking ReScript code formatting..."
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/*")
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/*")
if ./cli/rescript.js format -check $files; then
printf "${successGreen}✅ ReScript code formatting ok.${reset}\n"
else
Expand Down
4 changes: 3 additions & 1 deletion tests/syntax_benchmarks/Benchmark.ml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ end = struct
let parse_rescript src filename =
let p = Parser.make src filename in
let structure = ResParser.parse_implementation p in
assert (p.diagnostics == []);
if p.diagnostics != [] then (
Res_diagnostics.print_report p.diagnostics src;
assert false);
structure

let data_dir = "tests/syntax_benchmarks/data"
Expand Down
Loading