]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
resulttool/resultutils: allow index generation despite corrupt json
authorMichael Halstead <mhalstead@linuxfoundation.org>
Fri, 14 Jul 2023 17:46:13 +0000 (10:46 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 19 Jul 2023 18:37:35 +0000 (19:37 +0100)
non-release indexes will continue to generate when test output is
corrupted.

Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/resulttool/resultutils.py

index 7666331ba28122b0a07a58bb19a8e97ff2c1384d..c5521d81bd1f84e7ba090f906aff2670b215bcfe 100644 (file)
@@ -58,7 +58,11 @@ def append_resultsdata(results, f, configmap=store_map, configvars=extra_configv
             testseries = posixpath.basename(posixpath.dirname(url.path))
         else:
             with open(f, "r") as filedata:
-                data = json.load(filedata)
+                try:
+                    data = json.load(filedata)
+                except json.decoder.JSONDecodeError:
+                    print("Cannot decode {}. Possible corruption. Skipping.".format(f))
+                    data = ""
             testseries = os.path.basename(os.path.dirname(f))
     else:
         data = f