未验证 提交 bad6368d 编写于 作者: O openharmony_ci 提交者: Gitee

!143 适配处理JS测试套名有空格的情况

Merge pull request !143 from liguangjie/master
......@@ -1684,11 +1684,12 @@ class JSUnitTestDriver(IDriver):
suite_dict_list = json.loads(json_str).get("suites", [])
for suite_dict in suite_dict_list:
for class_name, test_name_dict_list in suite_dict.items():
tests_dict.update({class_name: []})
tests_dict.update({class_name.strip(): []})
for test_name_dict in test_name_dict_list:
for test_name in test_name_dict.values():
test = TestDescription(class_name, test_name)
tests_dict.get(class_name).append(test)
test = TestDescription(class_name.strip(),
test_name.strip())
tests_dict.get(class_name.strip()).append(test)
test_count += 1
except json.decoder.JSONDecodeError as json_error:
LOG.warning("Suites info is invalid: %s" % json_error)
......
......@@ -694,7 +694,7 @@ class JSUnitParser(IParser):
"ignore": ResultCode.SKIPPED,
"error": ResultCode.FAILED}
status = status_dict.get(match.group(1))
return test_name, status, run_time
return test_name.strip(), status, run_time
def handle_suites_started_tag(self):
self.state_machine.get_suites(reset=True)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册