Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
e1ef361f
A
avocado
项目概览
openeuler
/
avocado
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
avocado
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e1ef361f
编写于
8月 14, 2016
作者:
A
Amador Pahim
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "avocado.core: Cleanup runner->multiplexer API"
This reverts commit
b6cbe734
.
上级
8aef27bb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
30 deletion
+13
-30
avocado/core/multiplexer.py
avocado/core/multiplexer.py
+12
-5
avocado/core/runner.py
avocado/core/runner.py
+1
-25
未找到文件。
avocado/core/multiplexer.py
浏览文件 @
e1ef361f
...
...
@@ -412,15 +412,22 @@ class Mux(object):
else
:
return
len
(
test_suite
)
def
itertests
(
self
):
def
itertests
(
self
,
template
):
"""
Yield variant-id and test
params
Processes the template and yields test definition with proper
params
"""
if
self
.
variants
:
# Copy template and modify it's params
i
=
None
for
i
,
variant
in
enumerate
(
self
.
variants
,
1
):
yield
i
if
self
.
_has_multiple_variants
else
None
,
variant
test_factory
=
[
template
[
0
],
template
[
1
].
copy
()]
if
"params"
in
test_factory
[
1
]:
msg
=
(
"Unable to multiplex test %s, params are already "
"present in test factory: %s"
%
(
test_factory
[
0
],
test_factory
[
1
]))
raise
ValueError
(
msg
)
test_factory
[
1
][
'params'
]
=
(
variant
,
self
.
_mux_path
)
yield
test_factory
,
i
if
self
.
_has_multiple_variants
else
None
if
i
is
None
:
# No variants, use template
yield
Non
e
,
None
yield
templat
e
,
None
else
:
# No variants, use template
yield
Non
e
,
None
yield
templat
e
,
None
avocado/core/runner.py
浏览文件 @
e1ef361f
...
...
@@ -454,29 +454,6 @@ class TestRunner(object):
return
False
return
True
@
staticmethod
def
_iter_variants
(
template
,
mux
):
"""
Iterate through variants and set the params/variants accordingly.
:param template: test template
:param mux: the Mux object containing the variants
:return: Yields tuple(test_factory including params, variant id)
:raises ValueError: When variant and template declare params.
"""
for
variant
,
params
in
mux
.
itertests
():
if
params
:
if
"params"
in
template
[
1
]:
msg
=
(
"Unable to multiplex test %s, params are already "
"present in test factory: %s"
%
(
template
[
0
],
template
[
1
]))
raise
ValueError
(
msg
)
factory
=
[
template
[
0
],
template
[
1
].
copy
()]
factory
[
1
][
"params"
]
=
params
else
:
factory
=
template
yield
factory
,
variant
def
run_suite
(
self
,
test_suite
,
mux
,
timeout
=
0
,
replay_map
=
None
,
test_result_total
=
0
):
"""
...
...
@@ -506,8 +483,7 @@ class TestRunner(object):
test_template
[
1
][
'base_logdir'
]
=
self
.
job
.
logdir
test_template
[
1
][
'job'
]
=
self
.
job
break_loop
=
False
for
test_factory
,
variant
in
self
.
_iter_variants
(
test_template
,
mux
):
for
test_factory
,
variant
in
mux
.
itertests
(
test_template
):
index
+=
1
test_parameters
=
test_factory
[
1
]
name
=
test_parameters
.
get
(
"name"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录