diff mbox series

[08/13] selftest: resulttooltests.py: add multi-pair threshold test

Message ID 20260923190419.353493-9-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(), covering that
threshold filtering applies to all pairs when more than two sources
are provided, not just the first pair.

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

Patch

diff --git a/meta/lib/oeqa/selftest/cases/resulttooltests.py b/meta/lib/oeqa/selftest/cases/resulttooltests.py
index 76bcc53711..c80027bfed 100644
--- a/meta/lib/oeqa/selftest/cases/resulttooltests.py
+++ b/meta/lib/oeqa/selftest/cases/resulttooltests.py
@@ -771,3 +771,10 @@  class ResultToolTests(OESelftestTestCase):
         args = SimpleNamespace(threshold=0.0, sort_by_delta=False, limit=0)
         kept = [k for k, vals, deltas in durations.filter_sort_rows(rows, args)]
         self.assertEqual(sorted(kept), ['big_change', 'no_change'])
+
+    def test_durations_filter_sort_rows_threshold_checks_every_pair_not_just_first(self):
+        # 3 sources: only the 2nd pair crosses the threshold, the 1st doesn't
+        rows = [('t', [10.0, 11.0, 100.0], [(1.0, 10.0), (89.0, 809.0)])]
+        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'])