Add a test for resulttool.durations.parse_report_log(), covering correct Time(s) column extraction from a 'resulttool report' text log, and confirming the unrelated percentage-based status summary table above it is not mistaken for a Time(s) table.
AI-Generated: Uses Claude Sonnet 5 Signed-off-by: Trevor Gamblin <[email protected]> --- .../oeqa/selftest/cases/resulttooltests.py | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/meta/lib/oeqa/selftest/cases/resulttooltests.py b/meta/lib/oeqa/selftest/cases/resulttooltests.py index a380d08156..b3c6f3329b 100644 --- a/meta/lib/oeqa/selftest/cases/resulttooltests.py +++ b/meta/lib/oeqa/selftest/cases/resulttooltests.py @@ -697,3 +697,36 @@ class ResultToolTests(OESelftestTestCase): self.assertNotIn('test.Foo.test_no_duration', flattened[path]) self.assertEqual(flattened[path]['ptestresult.sections.bash'], 5.0) self.assertEqual(flattened[path]['ptestresult.sections.timedout'], 30.0) + + def test_durations_parse_report_log_extracts_time_column(self): + content = ( + "==============================================================================================================\n" + "Test Result Status Summary (Counts/Percentages sorted by testseries, ID)\n" + "==============================================================================================================\n" + "qemux86 | someresultid | 6 (86%) | 0 (0%) | 1 (14%)\n" + "\n" + "==============================================================================================================\n" + "qemux86 PTest Result Summary (Libc: glibc)\n" + "==============================================================================================================\n" + "--------------------------------------------------------------------------------------------------------------\n" + "Recipe | Passed | Failed | Skipped | Time(s) \n" + "--------------------------------------------------------------------------------------------------------------\n" + "acl | 1 | 0 | 0 | 1\n" + "bash | 43 | 0 | 0 | 48\n" + "timedout-suite | 1 | 0 | 0 | 30 T\n" + "--------------------------------------------------------------------------------------------------------------\n" + ) + with tempfile.NamedTemporaryFile(mode='w', suffix='.log', delete=False) as f: + f.write(content) + logpath = f.name + try: + parsed = durations.parse_report_log(logpath) + finally: + os.remove(logpath) + section = 'qemux86 PTest Result Summary (Libc: glibc)' + self.assertIn(section, parsed) + self.assertEqual(parsed[section]['acl'], 1.0) + self.assertEqual(parsed[section]['bash'], 48.0) + self.assertEqual(parsed[section]['timedout-suite'], 30.0) + # the status-summary table above (percentages, not a Time(s) table) must not be picked up + self.assertNotIn('someresultid', str(parsed)) -- 2.55.0
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#246543): https://lists.openembedded.org/g/openembedded-core/message/246543 Mute This Topic: https://lists.openembedded.org/mt/121399141/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
