Skip to content

[CI] Fix regression when checking error #982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 12, 2020
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
35 changes: 21 additions & 14 deletions CI/build/arduino-cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
skip_count = 0

# format
build_format = "| {:8} | {:44} | {:9} "
build_format_header = "| {:^8} | {:42} | {:^10} | {:^7} |"
build_format_result = "| {:^8} | {:42} | {:^19} | {:^6.2f}s |"
build_separator = "-" * 80


Expand Down Expand Up @@ -495,31 +496,37 @@ def check_status(status, build_conf, boardKo):
elif status[1] == 1:
# Check if failed due to a region overflowed
logFile = os.path.join(build_conf[3], sketch_name + ".log")
error_pattern = re.compile(":\\d+:\\d+:\\serror:\\s")
ld_pattern = re.compile("arm-none-eabi/bin/ld:")
overflow_pattern = re.compile(
"will not fit in region|region .+ overflowed by [\\d]+ bytes"
)
error_found = False
for i, line in enumerate(open(logFile)):
if ld_pattern.search(line):
if error_pattern.search(line):
error_found = True
elif ld_pattern.search(line):
# If one ld line is not for region overflowed --> failed
if overflow_pattern.search(line) is None:
result = "\033[31mfailed\033[0m "
boardKo.append(build_conf[0])
if args.ci:
cat(logFile)
nb_build_failed += 1
break
error_found = True
if error_found:
result = "\033[31mfailed\033[0m"
boardKo.append(build_conf[0])
if args.ci:
cat(logFile)
nb_build_failed += 1
break
else:
# else consider it succeeded
result = "\033[32msucceeded\033[0m"
result = "\033[32msucceeded*\033[0m"
if args.bin:
empty_bin(build_conf[0], sketch_name)
nb_build_passed += 1
else:
result = "\033[31merror\033[0m "
result = "\033[31merror\033[0m"

print(
(build_format + "| {:5.2f}s |").format(
(build_format_result).format(
"{}/{}".format(build_conf[1], build_conf[2]),
build_conf[0],
result,
Expand Down Expand Up @@ -730,12 +737,12 @@ def build_config(sketch, boardSkipped):
for pattern in na_sketch_pattern[build_conf_list[idx][0]]:
if re.search(pattern, sketch, re.IGNORECASE):
print(
(build_format + "| {:5.2f}s |").format(
(build_format_result).format(
"{}/{}".format(
build_conf_list[idx][1], build_conf_list[idx][2]
),
build_conf_list[idx][0],
"\033[33mskipped\033[0m ",
"\033[33mskipped\033[0m",
0.00,
)
)
Expand Down Expand Up @@ -782,7 +789,7 @@ def build_all():
for line in wrapped_path_:
print("| {:^76} |".format("{}".format(line)))
print(build_separator)
print((build_format + "| {:6} |").format("Num", "Board", "Result", "Time"))
print((build_format_header).format("Num", "Board", "Result", "Time"))
print(build_separator)

build_conf_list = build_config(sketch, boardSkipped)
Expand Down