Skip to content

Commit 8874627

Browse files
committed
update_bugs_by_version: Don't fail when the list gets updated
1 parent c1cbffc commit 8874627

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

scripts/update_bugs_by_version.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import json
1010
import re
11-
import sys
1211
from pathlib import Path
1312

1413
def comp(version_string):
@@ -35,7 +34,9 @@ def comp(version_string):
3534
continue
3635
value['bugs'] += [bug['name']]
3736

38-
new_contents = json.dumps(versions, sort_keys=True, indent=4, separators=(',', ': '))
39-
old_contents = (root_path / 'docs/bugs_by_version.json').read_text(encoding='utf8')
40-
(root_path / 'docs/bugs_by_version.json').write_text(new_contents, encoding='utf8')
41-
sys.exit(old_contents != new_contents)
37+
(root_path / 'docs/bugs_by_version.json').write_text(json.dumps(
38+
versions,
39+
sort_keys=True,
40+
indent=4,
41+
separators=(',', ': ')
42+
), encoding='utf8')

test/cmdlineTests.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ function test_via_ir_equivalence()
355355

356356
for yul_file in $(find . -name "${output_file_prefix}*.yul" | sort -V); do
357357
bin_output_two_stage+=$(
358-
msg_on_error --no-stderr "$SOLC" --strict-assembly --bin "${optimizer_flags[@]}" "$yul_file" |
358+
msg_on_error --no-stderr "$SOLC" --strict-assembly --bin "${optimizer_flags[@]}" "$yul_file" |
359359
sed '/^Binary representation:$/d' |
360360
sed '/^=======/d'
361361
)
@@ -375,8 +375,13 @@ function test_via_ir_equivalence()
375375

376376
## RUN
377377

378-
echo "Checking that the bug list is up to date..."
379-
"$REPO_ROOT"/scripts/update_bugs_by_version.py
378+
SOLTMPDIR=$(mktemp -d)
379+
printTask "Checking that the bug list is up to date..."
380+
cp "${REPO_ROOT}/docs/bugs_by_version.json" "${SOLTMPDIR}/original_bugs_by_version.json"
381+
"${REPO_ROOT}/scripts/update_bugs_by_version.py"
382+
diff --unified "${SOLTMPDIR}/original_bugs_by_version.json" "${REPO_ROOT}/docs/bugs_by_version.json" || \
383+
fail "The bug list in bugs_by_version.json was out of date and has been updated. Please investigate and submit a bugfix if necessary."
384+
rm -r "$SOLTMPDIR"
380385

381386
printTask "Testing unknown options..."
382387
(

0 commit comments

Comments
 (0)