Skip to contentSkip to conversation

scripts: Split ptest log extraction to separate script

PATCH New Richard Purdie 1 participant 1 message Jul 12, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts: Split ptest log extraction to separate script

The ptest extraction should really happen separately to the index generation, move it to do so.

Add code to only consider directories changed in the last 7 days to make the script faster.

Add an indexing target to config.json to trigger the script.

---
 config.json                          |  6 +++
 scripts/generate-ptest-logs.py       | 78 ++++++++++++++++++++++++++++
 scripts/generate-testresult-index.py | 14 -----
 3 files changed, 84 insertions(+), 14 deletions(-)
 create mode 100755 scripts/generate-ptest-logs.py
config.json +6 -0
index 6907f26..07bbd8e 100644
@@ -1343,6 +1343,12 @@
                 "EXTRACMDS": [ "${SCRIPTSDIR}/run-abint ${HELPERRESULTSDIR}/../../abint/"]
             }
         },
+        "indexing" : {
+            "step1" : {
+                "shortname" : "Extract ptest logs",
+                "EXTRACMDS" : ["${SCRIPTSDIR}/generate-ptest-logs.py /srv/autobuilder/autobuilder.yocto.io/pub/non-release/"]
+            }
+        },
         "meta-mingw" : {
             "NEEDREPOS" : ["poky", "meta-mingw"],
             "MACHINE" : "qemux86-64",
scripts/generate-ptest-logs.py new file +78 -0

78 lines not on this page · raw message

scripts/generate-testresult-index.py +0 -14
index 568154d..d6d0a8f 100755
@@ -145,20 +145,6 @@ for build in sorted(os.listdir(path), key=keygen, reverse=True):
 
     entries.append(entry)
 
-    # Also ensure we have saved out log data for ptest runs to aid debugging
-    if "ptest" in btype or btype in ["full", "quick"]:
-        for root, dirs, files in os.walk(buildpath):
-            for name in dirs:
-                if "ptest" in name:
-                    f = os.path.join(root, name)
-                    logs = glob.glob(f + "/*.log")
-                    if logs:
-                        continue
-                    subprocess.check_call(["resulttool", "log", f, "--dump-ptest", f])
-                    # Ensure we don't rerun every time with a dummy log
-                    with open(f + "/resulttool-done.log", "a+") as tf:
-                        tf.write("\n")
-
 with open("./index-table.html") as file_:
     t = Template(file_.read())