Skip to contentSkip to conversation

resulttool: Add support for ptests results for both musl and glibc

PATCH New Richard Purdie 1 participant 1 message Jul 23

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 resulttool: Add support for ptests results for both musl and glibc

The code currently assumed a DISTRO has one libc and can't handle the case where there are ptest results for both. Add in TCLIBC to the result data to allow them to be differentiated and add support in the reporting to see the difference between them.

We need to carefully handle the case where there is no TCLIBC data in the results as the code currently assumes all data is present.

---
 meta/classes-recipe/testimage.bbclass         |  1 +
 .../oeqa/selftest/cases/resulttooltests.py    |  2 +-
 scripts/lib/resulttool/report.py              | 50 ++++++++++++-------
 scripts/lib/resulttool/resultutils.py         | 11 +++-
 .../template/test_report_full_text.txt        | 10 ++--
 5 files changed, 48 insertions(+), 26 deletions(-)
meta/classes-recipe/testimage.bbclass +1 -0
index b89ac2862e3..5f0ec0b3a05 100644
@@ -159,6 +159,7 @@ def get_testimage_configuration(d, test_type, machine):
                     'IMAGE_BASENAME': d.getVar("IMAGE_BASENAME"),
                     'IMAGE_PKGTYPE': d.getVar("IMAGE_PKGTYPE"),
                     'STARTTIME': d.getVar("DATETIME"),
+                    'TCLIBC': d.getVar("TCLIBC"),
                     'HOST_DISTRO': oe.lsb.distro_identifier().replace(' ', '-'),
                     'LAYERS': get_layers(d.getVar("BBLAYERS"))}
     return configuration
meta/lib/oeqa/selftest/cases/resulttooltests.py +1 -1
index 2b0e089e959..b03a880b2bb 100644
@@ -64,7 +64,7 @@ class ResultToolTests(OESelftestTestCase):
                                   'test4': {'status': 'ERROR'},
                                   'test5': {'status': 'SKIPPED'}}}
         report = ResultsTextReport()
-        result_report = report.get_aggregated_test_result(None, result_data, 'DummyMachine')
+        result_report = report.get_aggregated_test_result(None, result_data, 'DummyMachine', 'glibc')
         self.assertTrue(result_report['passed'] == 2, msg="Passed count not correct:%s" % result_report['passed'])
         self.assertTrue(result_report['failed'] == 2, msg="Failed count not correct:%s" % result_report['failed'])
         self.assertTrue(result_report['skipped'] == 1, msg="Skipped count not correct:%s" % result_report['skipped'])
scripts/lib/resulttool/report.py +31 -19

122 lines not on this page · raw message

scripts/lib/resulttool/resultutils.py +9 -2
index b8fc79a6acd..53980f8007a 100644
@@ -28,7 +28,7 @@ flatten_map = {
 }
 regression_map = {
     "oeselftest": ['TEST_TYPE', 'MACHINE'],
-    "runtime": ['TESTSERIES', 'TEST_TYPE', 'IMAGE_BASENAME', 'MACHINE', 'IMAGE_PKGTYPE', 'DISTRO'],
+    "runtime": ['TESTSERIES', 'TEST_TYPE', 'IMAGE_BASENAME', 'MACHINE', 'IMAGE_PKGTYPE', 'DISTRO', 'TCLIBC'],
     "sdk": ['TESTSERIES', 'TEST_TYPE', 'IMAGE_BASENAME', 'MACHINE', 'SDKMACHINE'],
     "sdkext": ['TESTSERIES', 'TEST_TYPE', 'IMAGE_BASENAME', 'MACHINE', 'SDKMACHINE'],
     "manual": ['TEST_TYPE', 'TEST_MODULE', 'IMAGE_BASENAME', 'MACHINE']
@@ -87,7 +87,14 @@ def append_resultsdata(results, f, configmap=store_map, configvars=extra_configv
         testtype = data[res]["configuration"].get("TEST_TYPE")
         if testtype not in configmap:
             raise ValueError("Unknown test type %s" % testtype)
-        testpath = "/".join(data[res]["configuration"].get(i) for i in configmap[testtype])
+        paths = []
+        for i in configmap[testtype]:
+            try:
+                paths.append(data[res]["configuration"].get(i))
+            # Some variables may not exist in older data
+            except KeyError:
+                continue
+        testpath = "/".join(paths)
         if testpath not in results:
             results[testpath] = {}
         results[testpath][res] = data[res]
scripts/lib/resulttool/template/test_report_full_text.txt +6 -4
index 2efba2ef6f2..a39878a3e11 100644
@@ -11,21 +11,23 @@ Test Result Status Summary (Counts/Percentages sorted by testseries, ID)
 {{ 'Total'.ljust(maxlen['testseries']) }} | {{ reporttotalvalues['count'].ljust(maxlen['result_id']) }} | {{ reporttotalvalues['passed'].ljust(maxlen['passed']) }} | {{ reporttotalvalues['failed'].ljust(maxlen['failed']) }} | {{ reporttotalvalues['skipped'].ljust(maxlen['skipped']) }}
 --------------------------------------------------------------------------------------------------------------
 
+{% for libc in libcs %}
 {% for machine in machines %}
-{% if ptests[machine] %}
+{% if ptests[libc][machine] %}
 ==============================================================================================================
-{{ machine }} PTest Result Summary
+{{ machine }} PTest Result Summary (Libc: {{ libc }})
 ==============================================================================================================
 --------------------------------------------------------------------------------------------------------------
 {{ 'Recipe'.ljust(maxlen['ptest']) }} | {{ 'Passed'.ljust(maxlen['passed']) }} | {{ 'Failed'.ljust(maxlen['failed']) }} | {{ 'Skipped'.ljust(maxlen['skipped']) }} | {{ 'Time(s)'.ljust(10) }}
 --------------------------------------------------------------------------------------------------------------
-{% for ptest in ptests[machine] |sort %}
-{{ ptest.ljust(maxlen['ptest']) }} | {{ (ptests[machine][ptest]['passed']|string).ljust(maxlen['passed']) }} | {{ (ptests[machine][ptest]['failed']|string).ljust(maxlen['failed']) }} | {{ (ptests[machine][ptest]['skipped']|string).ljust(maxlen['skipped']) }} | {{ (ptests[machine][ptest]['duration']|string) }}
+{% for ptest in ptests[libc][machine] |sort %}
+{{ ptest.ljust(maxlen['ptest']) }} | {{ (ptests[libc][machine][ptest]['passed']|string).ljust(maxlen['passed']) }} | {{ (ptests[libc][machine][ptest]['failed']|string).ljust(maxlen['failed']) }} | {{ (ptests[libc][machine][ptest]['skipped']|string).ljust(maxlen['skipped']) }} | {{ (ptests[libc][machine][ptest]['duration']|string) }}
 {% endfor %}
 --------------------------------------------------------------------------------------------------------------
 
 {% endif %}
 {% endfor %}
+{% endfor %}
 
 {% for machine in machines %}
 {% if ltptests[machine] %}