scripts: Split ptest log extraction to separate script
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.
Signed-off-by Richard Purdie <[email protected]>
--- 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
@@ -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
@@ -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())