Merge branch 'ci/ttfw_fix_dut_exception_not_added_to_junit_report_v4.2' into 'release/v4.2'

ttfw: fix DUT exception not added to junit report (v4.2)

See merge request espressif/esp-idf!12142
This commit is contained in:
He Yin Ling
2021-05-26 03:11:26 +00:00
2 changed files with 2 additions and 3 deletions

View File

@ -210,7 +210,7 @@ def test_method(**kwargs):
# and raise exception in DUT close to fail test case if reset detected. # and raise exception in DUT close to fail test case if reset detected.
if close_errors: if close_errors:
for error in close_errors: for error in close_errors:
junit_test_case.add_failure_info(str(error)) junit_test_case.add_failure_info("env close error: ".format(error))
result = False result = False
if not case_info["junit_report_by_case"]: if not case_info["junit_report_by_case"]:
JunitReport.test_case_finish(junit_test_case) JunitReport.test_case_finish(junit_test_case)

View File

@ -451,8 +451,7 @@ class IDFDUT(DUT.SerialDUT):
def close(self): def close(self):
super(IDFDUT, self).close() super(IDFDUT, self).close()
if not self.allow_dut_exception and self.get_exceptions(): if not self.allow_dut_exception and self.get_exceptions():
Utility.console_log("DUT exception detected on {}".format(self), color="red") raise IDFDUTException("DUT exception detected on {}".format(self))
raise IDFDUTException()
class ESP32DUT(IDFDUT): class ESP32DUT(IDFDUT):