summaryrefslogtreecommitdiff
path: root/test-cli/test/runners
diff options
context:
space:
mode:
authorHector Fernandez <hector@iatec.biz>2020-07-01 10:45:34 +0200
committerHector Fernandez <hector@iatec.biz>2020-07-01 10:45:34 +0200
commit34df86b37d6838b115e65e5f3a332344afeb86b8 (patch)
tree946e1d7d6d55a4339e453c84c4fbbf4b785a1712 /test-cli/test/runners
parent9ac8a326412b04e4873b883c2f2a056ca0b22480 (diff)
downloadboard-34df86b37d6838b115e65e5f3a332344afeb86b8.zip
board-34df86b37d6838b115e65e5f3a332344afeb86b8.tar.gz
board-34df86b37d6838b115e65e5f3a332344afeb86b8.tar.bz2
Changes to adapt to new way to save results in DB. Created audio test. Added protections against unexpected status in DB.
Diffstat (limited to 'test-cli/test/runners')
-rw-r--r--test-cli/test/runners/simple.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/test-cli/test/runners/simple.py b/test-cli/test/runners/simple.py
index 22fe449..2eb61a4 100644
--- a/test-cli/test/runners/simple.py
+++ b/test-cli/test/runners/simple.py
@@ -59,8 +59,9 @@ class TextTestResult(unittest.TestResult):
def addError(self, test, err):
unittest.TestResult.addError(self, test, err)
- test.longMessage = err[1]
+ # test.longMessage = err[1]
self.result = self.ERROR
+ print(err[1])
def addFailure(self, test, err):
unittest.TestResult.addFailure(self, test, err)
@@ -73,17 +74,13 @@ class TextTestResult(unittest.TestResult):
self.runner.writeUpdate(self.result)
# save result data
for result in test.getresults():
- if "desc" in result.keys() and result["desc"]:
- if "type" in result.keys() and "data" in result.keys():
- if result["type"] == "string":
- self.__pgObj.upload_result_string(test.params["testidctl"], test.params["testid"],
- result["desc"], result["data"])
- elif result["type"] == "file":
- self.__pgObj.upload_result_file(test.params["testidctl"], test.params["testid"],
- result["desc"], result["data"])
+ self.__pgObj.upload_result_file(test.params["testidctl"], test.params["testid"],
+ result["description"], result["filepath"], result["mimetype"])
# SEND TO DB THE RESULT OF THE TEST
if self.result == self.PASS:
status = "TEST_COMPLETE"
+ resulttext = test.gettextresult()
else:
status = "TEST_FAILED"
- self.__pgObj.finish_test(test.params["testidctl"], test.params["testid"], status)
+ resulttext = test.longMessage
+ self.__pgObj.finish_test(test.params["testidctl"], test.params["testid"], status, resulttext)