From 74752c561c1242a016f95fdf1c2d68bae4e4a757 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Sun, 18 Jul 2021 16:17:11 +0100 Subject: [PATCH] Correctly extract parse errors from build reports --- tools/parse-reports.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/parse-reports.py b/tools/parse-reports.py index 5471af6f6..153e9b3a4 100755 --- a/tools/parse-reports.py +++ b/tools/parse-reports.py @@ -14,6 +14,7 @@ import os.path LUA_ERROR_LOCATION = re.compile(r"^\s+(/[\w./-]+):(\d+):", re.MULTILINE) +JAVA_LUA_ERROR_LOCATION = re.compile(r"^java.lang.IllegalStateException: (/[\w./-]+):(\d+):") JAVA_ERROR_LOCATION = re.compile(r"^\tat ([\w.]+)\.[\w]+\([\w.]+:(\d+)\)$", re.MULTILINE) ERROR_MESSAGE = re.compile(r"(.*)\nstack traceback:", re.DOTALL) @@ -46,6 +47,12 @@ def find_location(message: str) -> Optional[Tuple[str, str]]: if file: return file, location[2] + location = JAVA_LUA_ERROR_LOCATION.search(message) + if location: + file = find_file(location[1]) + if file: + return file, location[2] + for location in JAVA_ERROR_LOCATION.findall(message): file = find_file(location[0].replace(".", "/") + ".java") if file: