[golemfactory/golem] Structured local test result (#3128)

Elfoniok requested changes on this pull request.

> for l in log_content.splitlines():
missing_file = re.search(«^Warning: Path ‘(.*)’ not found», l,
re.IGNORECASE)
if missing_file:
# extract filename from warning message
— warnings.add(os.path.basename(missing_file.group(1)))
+ missing_path = missing_file.group(1)
+ fileInfo = (
+ (‘baseName’, os.path.basename(missing_path)),
+ (‘dirName’, os.path.dirname(missing_path))
+ )
+ warnings.append(fileInfo)
+
+ if bool(warnings):

conversion to bool is not required

> for l in log_content.splitlines():
missing_file = re.search(«^Warning: Path ‘(.*)’ not found», l,
re.IGNORECASE)
if missing_file:
# extract filename from warning message
— warnings.add(os.path.basename(missing_file.group(1)))
+ missing_path = missing_file.group(1)
+ fileInfo = (
+ (‘baseName’, os.path.basename(missing_path)),
+ (‘dirName’, os.path.dirname(missing_path))
+ )
+ warnings.append(fileInfo)
+
+ if bool(warnings):
+ warnings = sorted(warnings, key=lambda t: (t[0][1]))

That is better but you could sort items before inserting them so save some iterations.