Add a test for resulttool.durations.filter_sort_rows(), covering that
passing '-s/--sort-by-delta' correctly orders output by largest
absolute change first.

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 e6e75dd9b9..886c5bb3ed 100644
--- a/meta/lib/oeqa/selftest/cases/resulttooltests.py
+++ b/meta/lib/oeqa/selftest/cases/resulttooltests.py
@@ -788,3 +788,13 @@ class ResultToolTests(OESelftestTestCase):
         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'])
+
+    def 
test_durations_filter_sort_rows_sort_by_delta_orders_by_largest_change(self):
+        rows = [
+            ('small', [10.0, 11.0], [(1.0, 10.0)]),
+            ('big', [10.0, 30.0], [(20.0, 200.0)]),
+            ('medium', [10.0, 15.0], [(5.0, 50.0)]),
+        ]
+        args = SimpleNamespace(threshold=0.0, sort_by_delta=True, limit=0)
+        ordered = [k for k, vals, deltas in durations.filter_sort_rows(rows, 
args)]
+        self.assertEqual(ordered, ['big', 'medium', 'small'])
-- 
2.55.0

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

Reply via email to