[yocto-autobuilder-helper,4/4] scripts/generate-testresult-index.py: update index to list host data

Submitted by Sakib Sajal on July 9, 2021, 8:56 p.m. | Patch ID: 179951

Details

Message ID 20210709205609.233487-4-sakib.sajal@windriver.com
State New
Headers show

Commit Message

Sakib Sajal July 9, 2021, 8:56 p.m.
Host data is collected on failure by default. List the collected files
in the index.

Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
---
 scripts/generate-testresult-index.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/scripts/generate-testresult-index.py b/scripts/generate-testresult-index.py
index d85d606..5c33778 100755
--- a/scripts/generate-testresult-index.py
+++ b/scripts/generate-testresult-index.py
@@ -152,13 +152,15 @@  for build in sorted(os.listdir(path), key=keygen, reverse=True):
         buildhistory.append((reldir + "testresults/qemuarm/buildhistory.txt", "qemuarm"))
 
     hd = []
-    counter = 0
-    # do we really need the loop?
-    for p in glob.glob(buildpath + "/*/*/host_stats*top_summary.txt"):
+    for p in glob.glob(buildpath + "/*/*/host_stats*summary.txt"):
         n_split = p.split(build)
         res = reldir[0:-1] + n_split[1]
-        hd.append((res, str(counter)))
-        counter += 1
+        n = os.path.basename(p).split("host_stats_")[-1]
+        if "failure" in n:
+            n = n.split("_summary.txt")[0]
+        elif "top" in n:
+            n = n.split("_top_summary.txt")[0]
+        hd.append((res, n))
 
 
     branch = get_build_branch(buildpath)