Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Test Xdevice
提交
59a511a2
T
Test Xdevice
项目概览
OpenHarmony
/
Test Xdevice
8 个月 前同步成功
通知
6
Star
23
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Test Xdevice
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
59a511a2
编写于
8月 31, 2022
作者:
D
deveco_test
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复OHJS驱动Fail用例被标记为Block的bug
Signed-off-by:
N
deveco_test
<
liguangjie1@huawei.com
>
上级
8f48976a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
2 deletion
+12
-2
plugins/ohos/src/ohos/drivers/openharmony.py
plugins/ohos/src/ohos/drivers/openharmony.py
+8
-0
plugins/ohos/src/ohos/parser/parser.py
plugins/ohos/src/ohos/parser/parser.py
+4
-2
未找到文件。
plugins/ohos/src/ohos/drivers/openharmony.py
浏览文件 @
59a511a2
...
...
@@ -330,6 +330,8 @@ class OHJSUnitTestDriver(IDriver):
do_module_kit_setup
(
request
,
self
.
kits
)
self
.
runner
=
OHJSUnitTestRunner
(
self
.
config
)
self
.
runner
.
suites_name
=
request
.
get_module_name
()
if
self
.
rerun
:
self
.
runner
.
retry_times
=
self
.
runner
.
MAX_RETRY_TIMES
# execute test case
self
.
_get_runner_config
(
json_config
)
oh_jsunit_para_parse
(
self
.
runner
,
self
.
config
.
testargs
)
...
...
@@ -400,6 +402,7 @@ class OHJSUnitTestDriver(IDriver):
LOG
.
debug
(
"Ready to run with rerun, expect run: %s"
%
len
(
expected_tests
))
test_run
=
self
.
_run_tests
(
listener
)
self
.
runner
.
retry_times
-=
1
LOG
.
debug
(
"Run with rerun, has run: %s"
%
len
(
test_run
)
if
test_run
else
0
)
if
len
(
test_run
)
<
len
(
expected_tests
):
...
...
@@ -421,6 +424,7 @@ class OHJSUnitTestDriver(IDriver):
self
.
runner
.
add_arg
(
"class"
,
","
.
join
(
tests
))
LOG
.
debug
(
"Ready to rerun twice, expect run: %s"
%
len
(
expected_tests
))
test_run
=
self
.
_run_tests
(
listener
)
self
.
runner
.
retry_times
-=
1
LOG
.
debug
(
"Rerun twice, has run: %s"
%
len
(
test_run
))
if
len
(
test_run
)
<
len
(
expected_tests
):
expected_tests
=
TestDescription
.
remove_test
(
expected_tests
,
...
...
@@ -449,6 +453,8 @@ class OHJSUnitTestDriver(IDriver):
class
OHJSUnitTestRunner
:
MAX_RETRY_TIMES
=
3
def
__init__
(
self
,
config
):
self
.
arg_list
=
{}
self
.
suites_name
=
None
...
...
@@ -458,6 +464,7 @@ class OHJSUnitTestRunner:
self
.
finished
=
False
self
.
expect_tests_dict
=
dict
()
self
.
finished_observer
=
None
self
.
retry_times
=
1
def
dry_run
(
self
):
parsers
=
get_plugin
(
Plugin
.
PARSER
,
CommonParserType
.
oh_jsunit_list
)
...
...
@@ -483,6 +490,7 @@ class OHJSUnitTestRunner:
def
notify_finished
(
self
):
if
self
.
finished_observer
:
self
.
finished_observer
.
notify_task_finished
()
self
.
retry_times
-=
1
def
_get_shell_handler
(
self
,
listener
):
parsers
=
get_plugin
(
Plugin
.
PARSER
,
CommonParserType
.
oh_jsunit
)
...
...
plugins/ohos/src/ohos/parser/parser.py
浏览文件 @
59a511a2
...
...
@@ -1151,7 +1151,8 @@ class OHJSUnitTestParser(IParser):
result
=
copy
.
copy
(
test_info
)
result
.
code
=
ResultCode
.
FAILED
.
value
listener
.
__ended__
(
LifeCycle
.
TestCase
,
result
)
if
listener
.
__class__
.
__name__
==
"ReportListener"
:
if
listener
.
__class__
.
__name__
==
"ReportListener"
\
and
self
.
runner
.
retry_times
>
1
:
index
=
list
(
listener
.
tests
.
keys
())[
-
1
]
listener
.
tests
.
pop
(
index
)
test_info
.
is_completed
=
True
...
...
@@ -1165,7 +1166,8 @@ class OHJSUnitTestParser(IParser):
result
=
copy
.
copy
(
test_info
)
result
.
code
=
ResultCode
.
FAILED
.
value
listener
.
__ended__
(
LifeCycle
.
TestCase
,
result
)
if
listener
.
__class__
.
__name__
==
"ReportListener"
:
if
listener
.
__class__
.
__name__
==
"ReportListener"
\
and
self
.
runner
.
retry_times
>
1
:
index
=
list
(
listener
.
tests
.
keys
())[
-
1
]
listener
.
tests
.
pop
(
index
)
test_info
.
is_completed
=
True
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录