mirror of
https://gitee.com/openharmony/testfwk_xdevice
synced 2025-02-10 12:42:46 +00:00
!315 1、修复ShellKit的teardown-localcommand命令在Linux无法执行的问题;2、修复App died的情况下,对应的错误信息未被设为模块的报错的问题
Merge pull request !315 from liangzhuowei/master
This commit is contained in:
commit
207cdfd943
@ -364,8 +364,10 @@ class OHJSUnitTestParser(IParser):
|
||||
self.handler_suites_end()
|
||||
|
||||
def _handle_result_msg(self, line):
|
||||
if OHJSUnitItemConstants.APP_DIED.value in line:
|
||||
is_app_died = OHJSUnitItemConstants.APP_DIED.value in line
|
||||
if is_app_died:
|
||||
self.__test_finish_result_msg = line.replace(OHJSUnitPrefixes.TEST_FINISHED_RESULT_MSG.value, '')
|
||||
if is_app_died and not self.state_machine.is_suite_empty():
|
||||
test_result = self.state_machine.test()
|
||||
suite = self.state_machine.suite()
|
||||
if not test_result.is_completed:
|
||||
@ -572,8 +574,10 @@ class OHJSWorkParser(IParser):
|
||||
self.parse_key(line, len(OHJSUnitPrefixes.STATUS.value))
|
||||
|
||||
def _handle_result_msg(self, line):
|
||||
if OHJSUnitItemConstants.APP_DIED.value in line and not self.state_machine.is_suite_empty():
|
||||
is_app_died = OHJSUnitItemConstants.APP_DIED.value in line
|
||||
if is_app_died:
|
||||
self.__test_finish_result_msg = line.replace(OHJSUnitPrefixes.TEST_FINISHED_RESULT_MSG.value, '')
|
||||
if is_app_died and not self.state_machine.is_suite_empty():
|
||||
test_result = self.state_machine.test()
|
||||
suite = self.state_machine.suite()
|
||||
if not test_result.is_completed:
|
||||
|
@ -505,9 +505,9 @@ class ShellKit(ITestKit):
|
||||
LOG.info("No teardown-localcommand to run, skipping!")
|
||||
else:
|
||||
for command in self.tear_down_local_command:
|
||||
subprocess.run(command)
|
||||
ret = subprocess.run(command, capture_output=True, text=True)
|
||||
LOG.info("Teardown-localcommand run: {}".format(ret))
|
||||
LOG.info("Run local command: {}".format(command))
|
||||
ret = exec_cmd(command)
|
||||
LOG.info("command output: {}".format(ret))
|
||||
|
||||
|
||||
@dataclass
|
||||
|
Loading…
x
Reference in New Issue
Block a user