diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-03-05 11:51:28 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-03-05 11:52:54 +0100 |
commit | 4602afc0e5833991dff792c7324f994c0bc136d0 (patch) | |
tree | c0cb846404b84aabc37afedd7835216767de22e0 /shell/test | |
parent | 2b9d1ef05865718b9af3f393bd09232b6220b774 (diff) | |
download | rules-cc-4602afc0e5833991dff792c7324f994c0bc136d0.tar.gz |
test summarizer: in case of FLAKY tests, also report failure rate
Diffstat (limited to 'shell/test')
-rwxr-xr-x | shell/test/summarizer | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/shell/test/summarizer b/shell/test/summarizer index 5fb0311..72cd1b9 100755 --- a/shell/test/summarizer +++ b/shell/test/summarizer @@ -19,12 +19,14 @@ import time from typing import Any, Dict, List g_RESULTS: Dict[str, List[Any]] = {} +g_COUNT: float = 0 time_start: float = time.time() time_stop: float = 0 for attempt in os.listdir("."): if os.path.isdir(attempt): + g_COUNT += 1 with open(os.path.join(attempt, "result")) as f: result = f.read().strip() g_RESULTS[result] = g_RESULTS.get(result, []) + [int(attempt)] @@ -58,11 +60,14 @@ with open("time-stop", "w") as f: with open("stdout", "w") as f: f.write("Summary: %s\n\n" % (result, )) f.write("PASS: %s\n" % (sorted(g_RESULTS.get("PASS", [])), )) - f.write("FAIL: %s\n" % (sorted(g_RESULTS.get("FAIL", [])), )) + failures =sorted(g_RESULTS.get("FAIL", [])) + f.write("FAIL: %s\n" % (failures, )) g_RESULTS.pop("PASS", None) g_RESULTS.pop("FAIL", None) if g_RESULTS: f.write("\nother results: %r\n" % (g_RESULTS, )) + if result == "FLAKY": + f.write("\nFailure rate %5.2f%%\n" % (100.0 * len(failures) / g_COUNT)) with open("stderr", "w") as f: pass |