Improve error messages

This commit is contained in:
Benj Fassbind
2022-07-12 10:54:44 +02:00
parent 1d4e6183be
commit ff3bf4b180

View File

@@ -291,7 +291,11 @@ class BaseTest(object):
if is_aptly_command:
# remove the last two rows as go tests always print PASS/FAIL and coverage in those
# two lines. This would otherwise fail the tests as they would not match gold
output, _, returncode = re.findall(r"((.|\n)*)EXIT: (\d)\n.*\ncoverage: .*", raw_output.decode("utf-8"))[0]
matches = re.findall(r"((.|\n)*)EXIT: (\d)\n.*\ncoverage: .*", raw_output.decode("utf-8"))
if not matches:
raise Exception("no matches found in output '%s'" % raw_output.decode("utf-8"))
output, _, returncode = matches[0]
output = output.encode()
returncodes.append(int(returncode))