Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 5 additions & 17 deletions jenkins/genReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

def write_summary(output_file, summary_data):
"""
Writes summary to output file and creates any directories in the output_file's path
Writes summary to output file and creates any directories in the output_file's path
that already don't exist
"""

Expand Down Expand Up @@ -46,24 +46,17 @@ def read_log(input_file):

Returns a dictionary with "errors" and "info" as the keys to lists of log
file output to include in the summary

NOTE: GRT-0119 is skipped for right now
"""

summary_data = { "errors": [], "info": [] }
orfs_regex_error = re.compile(r"^\[error ?(\w+-\d+)?\]", re.IGNORECASE)
bazel_regex_error = re.compile(r"^error:", re.IGNORECASE)
regex_hitrate = re.compile(r"^INFO\:\s+\d+\s+processes\:\s+\d+\s+remote\s+cache\s+hit")

with open(input_file, "r") as in_fh:
for line in in_fh:
orfs_result = orfs_regex_error.match(line)
if orfs_result:
orfs_error_code = orfs_result.group(1)
print(orfs_error_code)
# skip "Routing congestion too high" error for now
if orfs_error_code != "GRT-0119":
summary_data["errors"].append(line.strip())
if orfs_regex_error.match(line):
summary_data["errors"].append(line.strip())
elif re.search(bazel_regex_error, line):
summary_data["errors"].append(line.strip())
elif line.startswith("INFO: Elapsed time") or re.search(regex_hitrate, line) or line.startswith("INFO: Build completed successfully"):
Expand All @@ -79,8 +72,3 @@ def read_log(input_file):

summary_data = read_log(args.input_file)
write_summary(args.output_file, summary_data)
sys.exit(len(summary_data["errors"]) > 0)