Add a digest result in the end of the report

This commit is contained in:
Mikhail f. Shiryaev 2023-09-28 11:22:38 +02:00
parent 8e00e8b3a9
commit 183af376e1
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4

View File

@ -101,7 +101,7 @@ def process_results(
report_path = result_directory / "test_result.json"
if not report_path.exists():
logging.info("No output log on path %s", report_path)
return "error", "No output log", test_results
return ERROR, "No output log", test_results
with open(report_path, "r", encoding="utf-8") as j:
report = json.load(j)
@ -109,11 +109,6 @@ def process_results(
total_counter = report["tests"]
failed_counter = report["failures"]
error_counter = report["errors"]
status = SUCCESS
if failed_counter:
status = FAILURE
if error_counter:
status = ERROR
description = ""
SEGFAULT = "Segmentation fault. "
@ -154,13 +149,24 @@ def process_results(
)
)
check_status = SUCCESS
tests_status = OK
tests_time = float(report["time"][:-1])
if failed_counter:
check_status = FAILURE
test_status = FAIL
if error_counter:
check_status = ERROR
test_status = ERROR
test_results.append(TestResult(report["name"], tests_status, tests_time))
if not description:
description += (
f"fail: {failed_counter + error_counter}, "
f"passed: {total_counter - failed_counter - error_counter}"
)
return status, description, test_results
return check_status, description, test_results
def main():