From d6c234ddce28763cb71e6c5dc4e95b9fbb92bac4 Mon Sep 17 00:00:00 2001 From: Omar Abou Selo Date: Tue, 17 Sep 2024 15:02:56 +0300 Subject: [PATCH] Make show_common_failures script group by template id if present (#214) --- backend/scripts/show_common_failures.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/scripts/show_common_failures.py b/backend/scripts/show_common_failures.py index 57b6937c..d27dabfb 100644 --- a/backend/scripts/show_common_failures.py +++ b/backend/scripts/show_common_failures.py @@ -34,7 +34,9 @@ def main(artefact_id: int): ).json() failing_test_cases.extend( - tr["name"] for tr in test_results if tr["status"] == "FAILED" + tr["template_id"] or tr["name"] + for tr in test_results + if tr["status"] == "FAILED" ) sys.stdout.write("\r") @@ -50,7 +52,8 @@ def main(artefact_id: int): if __name__ == "__main__": parser = argparse.ArgumentParser( description="Given an artefact id, prints the most common failing" - " test cases under undecided test executions." + " test cases under undecided test executions. Groups tests by template_id" + " if present and case name otherwise" "\nUses TO_API_URL environment if defined defaulting to production otherwise", ) parser.add_argument("artefact_id", type=int)