summaryrefslogtreecommitdiff
path: root/util/zephyr_to_resultdb.py
diff options
context:
space:
mode:
Diffstat (limited to 'util/zephyr_to_resultdb.py')
-rwxr-xr-xutil/zephyr_to_resultdb.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/util/zephyr_to_resultdb.py b/util/zephyr_to_resultdb.py
index 5d5edc6c99..e9cc191b43 100755
--- a/util/zephyr_to_resultdb.py
+++ b/util/zephyr_to_resultdb.py
@@ -2,6 +2,7 @@
# Copyright 2022 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+
""" Upload twister results to ResultDB
Usage:
@@ -135,7 +136,12 @@ def testcase_to_result(testsuite, testcase, base_tags, config_tags):
assert_msg = re.findall(
r"Assertion failed.*$", testcase["log"], re.MULTILINE
)
- result["failureReason"] = {"primaryErrorMessage": assert_msg[0]}
+ if assert_msg:
+ result["failureReason"] = {"primaryErrorMessage": assert_msg[0]}
+ else:
+ result["failureReason"] = {
+ "primaryErrorMessage": "Assert not found - possibly occurred in test setup"
+ }
return result