mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
test: fix CI UT job pass even ut app bootup fail
This commit is contained in:
parent
09e72776dc
commit
323a790f01
@ -293,6 +293,7 @@ def run_unit_test_cases(env, extra_data):
|
|||||||
failed_cases.append(one_case["name"])
|
failed_cases.append(one_case["name"])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
junit_test_case.add_failure_info("Unexpected exception: " + str(e))
|
junit_test_case.add_failure_info("Unexpected exception: " + str(e))
|
||||||
|
failed_cases.append(one_case["name"])
|
||||||
finally:
|
finally:
|
||||||
TinyFW.JunitReport.test_case_finish(junit_test_case)
|
TinyFW.JunitReport.test_case_finish(junit_test_case)
|
||||||
|
|
||||||
@ -420,7 +421,7 @@ def get_dut(duts, env, name, ut_config, app_bin=None):
|
|||||||
return dut
|
return dut
|
||||||
|
|
||||||
|
|
||||||
def run_one_multiple_devices_case(duts, ut_config, env, one_case, failed_cases, app_bin, junit_test_case):
|
def run_one_multiple_devices_case(duts, ut_config, env, one_case, app_bin, junit_test_case):
|
||||||
lock = threading.RLock()
|
lock = threading.RLock()
|
||||||
threads = []
|
threads = []
|
||||||
send_signal_list = []
|
send_signal_list = []
|
||||||
@ -442,12 +443,9 @@ def run_one_multiple_devices_case(duts, ut_config, env, one_case, failed_cases,
|
|||||||
if not thread.result:
|
if not thread.result:
|
||||||
[thd.stop() for thd in threads]
|
[thd.stop() for thd in threads]
|
||||||
|
|
||||||
if result:
|
if not result:
|
||||||
Utility.console_log("Success: " + one_case["name"], color="green")
|
|
||||||
else:
|
|
||||||
failed_cases.append(one_case["name"])
|
|
||||||
junit_test_case.add_failure_info(output)
|
junit_test_case.add_failure_info(output)
|
||||||
Utility.console_log("Failed: " + one_case["name"], color="red")
|
return result
|
||||||
|
|
||||||
|
|
||||||
@IDF.idf_unit_test(env_tag="UT_T2_1", junit_report_by_case=True)
|
@IDF.idf_unit_test(env_tag="UT_T2_1", junit_report_by_case=True)
|
||||||
@ -478,13 +476,19 @@ def run_multiple_devices_cases(env, extra_data):
|
|||||||
for ut_config in case_config:
|
for ut_config in case_config:
|
||||||
Utility.console_log("Running unit test for config: " + ut_config, "O")
|
Utility.console_log("Running unit test for config: " + ut_config, "O")
|
||||||
for one_case in case_config[ut_config]:
|
for one_case in case_config[ut_config]:
|
||||||
|
result = False
|
||||||
junit_test_case = TinyFW.JunitReport.create_test_case("[{}] {}".format(ut_config, one_case["name"]))
|
junit_test_case = TinyFW.JunitReport.create_test_case("[{}] {}".format(ut_config, one_case["name"]))
|
||||||
try:
|
try:
|
||||||
run_one_multiple_devices_case(duts, ut_config, env, one_case, failed_cases,
|
result = run_one_multiple_devices_case(duts, ut_config, env, one_case,
|
||||||
one_case.get('app_bin'), junit_test_case)
|
one_case.get('app_bin'), junit_test_case)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
junit_test_case.add_failure_info("Unexpected exception: " + str(e))
|
junit_test_case.add_failure_info("Unexpected exception: " + str(e))
|
||||||
finally:
|
finally:
|
||||||
|
if result:
|
||||||
|
Utility.console_log("Success: " + one_case["name"], color="green")
|
||||||
|
else:
|
||||||
|
failed_cases.append(one_case["name"])
|
||||||
|
Utility.console_log("Failed: " + one_case["name"], color="red")
|
||||||
TinyFW.JunitReport.test_case_finish(junit_test_case)
|
TinyFW.JunitReport.test_case_finish(junit_test_case)
|
||||||
|
|
||||||
if failed_cases:
|
if failed_cases:
|
||||||
@ -631,6 +635,7 @@ def run_multiple_stage_cases(env, extra_data):
|
|||||||
failed_cases.append(one_case["name"])
|
failed_cases.append(one_case["name"])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
junit_test_case.add_failure_info("Unexpected exception: " + str(e))
|
junit_test_case.add_failure_info("Unexpected exception: " + str(e))
|
||||||
|
failed_cases.append(one_case["name"])
|
||||||
finally:
|
finally:
|
||||||
TinyFW.JunitReport.test_case_finish(junit_test_case)
|
TinyFW.JunitReport.test_case_finish(junit_test_case)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user