diff mbox series

[09/13] selftest: resulttooltests.py: add None-pct threshold test

Message ID 20260923190419.353493-10-tgamblin@baylibre.com
State New
Headers show
Series resulttool: add 'durations' subcommand and selftests | expand

Commit Message

Trevor Gamblin Sept. 23, 2026, 7:04 p.m. UTC
Add a test for resulttool.durations.filter_sort_rows(), ensuring that a
'None' percentage (i.e. when both runs round to 0) never satisfies a
threshold.

AI-Generated: Uses Claude Sonnet 5
---
 meta/lib/oeqa/selftest/cases/resulttooltests.py | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/meta/lib/oeqa/selftest/cases/resulttooltests.py b/meta/lib/oeqa/selftest/cases/resulttooltests.py
index c80027bfed..e6e75dd9b9 100644
--- a/meta/lib/oeqa/selftest/cases/resulttooltests.py
+++ b/meta/lib/oeqa/selftest/cases/resulttooltests.py
@@ -778,3 +778,13 @@  class ResultToolTests(OESelftestTestCase):
         args = SimpleNamespace(threshold=50.0, sort_by_delta=False, limit=0)
         kept = [k for k, vals, deltas in durations.filter_sort_rows(rows, args)]
         self.assertEqual(kept, ['t'])
+
+    def test_durations_filter_sort_rows_threshold_ignores_suppressed_none_pct(self):
+        # a None pct (both runs round to 0s, see build_rows) must never satisfy a threshold
+        rows = [
+            ('tiny', [0.2, 0.4], [(0.2, None)]),
+            ('big', [10.0, 20.0], [(10.0, 100.0)]),
+        ]
+        args = SimpleNamespace(threshold=1.0, sort_by_delta=False, limit=0)
+        kept = [k for k, vals, deltas in durations.filter_sort_rows(rows, args)]
+        self.assertEqual(kept, ['big'])