mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
tools: Report OverflowErrors in url coverage report.
This commit is contained in:
@@ -233,8 +233,18 @@ def write_instrumentation_reports():
|
|||||||
fn = os.path.join(var_dir, 'url_coverage.txt')
|
fn = os.path.join(var_dir, 'url_coverage.txt')
|
||||||
with open(fn, 'w') as f:
|
with open(fn, 'w') as f:
|
||||||
for call in calls:
|
for call in calls:
|
||||||
|
try:
|
||||||
line = ujson.dumps(call)
|
line = ujson.dumps(call)
|
||||||
f.write(line + '\n')
|
f.write(line + '\n')
|
||||||
|
except OverflowError:
|
||||||
|
print('''
|
||||||
|
A JSON overflow error was encountered while
|
||||||
|
producing the URL coverage report. Sometimes
|
||||||
|
this indicates that a test is passing objects
|
||||||
|
into methods like client_post(), which is
|
||||||
|
unnecessary and leads to false positives.
|
||||||
|
''')
|
||||||
|
print(call)
|
||||||
|
|
||||||
print('URL coverage report is in %s' % (fn,))
|
print('URL coverage report is in %s' % (fn,))
|
||||||
print('Try running: ./tools/analyze-url-coverage')
|
print('Try running: ./tools/analyze-url-coverage')
|
||||||
|
|||||||
Reference in New Issue
Block a user