diff mbox series

[07/13] selftest: resulttooltests.py: add threshold-disabled test

Message ID 20260923190419.353493-8-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
a threshold of 0 (the default) disables filtering entirely, so all
rows are kept regardless of their delta.

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

Patch

diff --git a/meta/lib/oeqa/selftest/cases/resulttooltests.py b/meta/lib/oeqa/selftest/cases/resulttooltests.py
index a884de3949..76bcc53711 100644
--- a/meta/lib/oeqa/selftest/cases/resulttooltests.py
+++ b/meta/lib/oeqa/selftest/cases/resulttooltests.py
@@ -762,3 +762,12 @@  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, ['big_change'])
+
+    def test_durations_filter_sort_rows_threshold_zero_disables_filtering(self):
+        rows = [
+            ('big_change', [10.0, 20.0], [(10.0, 100.0)]),
+            ('no_change', [10.0, 10.0], [(0.0, 0.0)]),
+        ]
+        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'])