diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-03-29 16:37:22 +0200 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2018-05-30 18:02:12 -0400 |
commit | 248a77871d2ae7c281498fbb5eedbbd19c7c696f (patch) | |
tree | f4343c952568f83fe98f601909cc620700cb431c /framework | |
parent | d54e84c2ea67f18d2c2b63c9bc9ca679f98c2f36 (diff) |
framework/html: guard against errors writing individual test results
v2: check ENAMETOOLONG
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/summary/html_.py | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/framework/summary/html_.py b/framework/summary/html_.py index f7fdc8576..14dd76fa8 100644 --- a/framework/summary/html_.py +++ b/framework/summary/html_.py @@ -31,6 +31,7 @@ import os import shutil import sys import tempfile +import traceback import mako from mako.lookup import TemplateLookup @@ -113,13 +114,19 @@ def _make_testrun_info(results, destination, exclude=None): if value.result not in exclude: core.check_dir(temp_path) - with open(html_path, 'wb') as out: - out.write(_TEMPLATES.get_template( - 'test_result.mako').render( - testname=key, - value=value, - css=os.path.relpath(result_css, temp_path), - index=os.path.relpath(index, temp_path))) + try: + with open(html_path, 'wb') as out: + out.write(_TEMPLATES.get_template( + 'test_result.mako').render( + testname=key, + value=value, + css=os.path.relpath(result_css, temp_path), + index=os.path.relpath(index, temp_path))) + except OSError as e: + if e.errno == errno.ENAMETOOLONG: + print('WARN: filename "{}" too long'.format(html_name)) + else: + raise def _make_comparison_pages(results, destination, exclude): |