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 --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'])
-- 
2.55.0

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

Reply via email to