Add a test for resulttool.durations.filter_sort_rows(), covering
correct filtering when the '-t/--threshold' percentage is used to ignore
result rows below it.

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

diff --git a/meta/lib/oeqa/selftest/cases/resulttooltests.py 
b/meta/lib/oeqa/selftest/cases/resulttooltests.py
index 28acc939f1..a884de3949 100644
--- a/meta/lib/oeqa/selftest/cases/resulttooltests.py
+++ b/meta/lib/oeqa/selftest/cases/resulttooltests.py
@@ -752,3 +752,13 @@ class ResultToolTests(OESelftestTestCase):
         self.assertEqual(len(deltas), 2)
         self.assertEqual(deltas[0], (90.0, 900.0))
         self.assertEqual(deltas[1][0], -89.0)
+
+    def test_durations_filter_sort_rows_threshold_keeps_rows_above_it(self):
+        rows = [
+            ('big_change', [10.0, 20.0], [(10.0, 100.0)]),
+            ('small_change', [10.0, 11.0], [(1.0, 10.0)]),
+            ('no_change', [10.0, 10.0], [(0.0, 0.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, ['big_change'])
-- 
2.55.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#246546): 
https://lists.openembedded.org/g/openembedded-core/message/246546
Mute This Topic: https://lists.openembedded.org/mt/121399147/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to