aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2024-04-04 13:01:47 +0200
committerVratko Polak <vrpolak@cisco.com>2024-04-04 13:54:46 +0000
commitb23313828acd614bbf13abbe88452ee37f1296cb (patch)
tree2ff8c4d0f06867482a5ae49d5fb35e12c75180c1
parent7535cb6bbbcaf2b66db5459d0b3470b13e12a383 (diff)
Fix(perpatch): improve compare script outputoper-240402
+ Make tests more searchable by "Test name" prefix. + Shorten the output code (fewer duplication and continues). Change-Id: I0adfac146a689466345a30646e41fe948ea264ae Signed-off-by: Vratko Polak <vrpolak@cisco.com> (cherry picked from commit 6d69d728bf9e469641550a57cf7bc37c7d19b84e)
-rw-r--r--resources/tools/integrated/compare_perpatch.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/resources/tools/integrated/compare_perpatch.py b/resources/tools/integrated/compare_perpatch.py
index ab1a557560..3821054849 100644
--- a/resources/tools/integrated/compare_perpatch.py
+++ b/resources/tools/integrated/compare_perpatch.py
@@ -114,15 +114,14 @@ def main() -> int:
# TODO: Version of classify that takes max_value and list of stats?
# That matters if only stats (not list of floats) are given.
classified_list = jumpavg.classify([parent_values, current_values])
- if len(classified_list) < 2:
- print(f"Test {name}: normal (no anomaly)")
- continue
- anomaly = classified_list[1].comment
- if anomaly == "regression":
- print(f"Test {name}: anomaly regression")
- exit_code = 3 # 1 or 2 can be caused by other errors
- continue
- print(f"Test {name}: anomaly {anomaly}")
+ anomaly_name = "normal (no anomaly)"
+ if len(classified_list) > 1:
+ anomaly = classified_list[1].comment
+ anomaly_name = "anomaly progression"
+ if anomaly == "regression":
+ anomaly_name = "anomaly regression"
+ exit_code = 3 # 1 or 2 can be caused by other errors
+ print(f"Test name {name}: {anomaly_name}")
print(f"Exit code: {exit_code}")
return exit_code