Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
39c994d1
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
39c994d1
编写于
3月 02, 2017
作者:
A
Amador Pahim
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'ldoktor-test-variables3'
Signed-off-by:
N
Amador Pahim
<
apahim@redhat.com
>
上级
9081a15d
99af5079
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
37 addition
and
12 deletion
+37
-12
avocado/core/runner.py
avocado/core/runner.py
+1
-1
avocado/core/test.py
avocado/core/test.py
+30
-10
avocado/plugins/xunit.py
avocado/plugins/xunit.py
+6
-1
未找到文件。
avocado/core/runner.py
浏览文件 @
39c994d1
...
...
@@ -302,7 +302,7 @@ class TestRunner(object):
instance
=
loader
.
load_test
(
test_factory
)
if
instance
.
runner_queue
is
None
:
instance
.
runner_queue
=
queue
instance
.
set_runner_queue
(
queue
)
runtime
.
CURRENT_TEST
=
instance
early_state
=
instance
.
get_state
()
early_state
[
'early_status'
]
=
True
...
...
avocado/core/test.py
浏览文件 @
39c994d1
...
...
@@ -225,15 +225,14 @@ class Test(unittest.TestCase):
params
=
[]
elif
isinstance
(
params
,
tuple
):
params
,
mux_path
=
params
[
0
],
params
[
1
]
self
.
params
=
varianter
.
AvocadoParams
(
params
,
self
.
name
,
mux_path
,
self
.
default_params
)
self
.
__
params
=
varianter
.
AvocadoParams
(
params
,
self
.
name
,
mux_path
,
self
.
default_params
)
default_timeout
=
getattr
(
self
,
"timeout"
,
None
)
self
.
timeout
=
self
.
params
.
get
(
"timeout"
,
default
=
default_timeout
)
self
.
log
.
info
(
'START %s'
,
self
.
name
)
self
.
text_output
=
None
self
.
__status
=
None
self
.
__fail_reason
=
None
self
.
__fail_class
=
None
...
...
@@ -243,7 +242,7 @@ class Test(unittest.TestCase):
self
.
paused
=
False
self
.
paused_msg
=
''
self
.
runner_queue
=
runner_queue
self
.
__
runner_queue
=
runner_queue
unittest
.
TestCase
.
__init__
(
self
,
methodName
=
methodName
)
...
...
@@ -289,6 +288,13 @@ class Test(unittest.TestCase):
"""
return
self
.
__outputdir
@
property
def
params
(
self
):
"""
Parameters of this test (AvocadoParam instance)
"""
return
self
.
__params
@
property
def
basedir
(
self
):
"""
...
...
@@ -365,6 +371,22 @@ class Test(unittest.TestCase):
cache_dirs
.
append
(
datadir_cache
)
return
cache_dirs
@
property
def
runner_queue
(
self
):
"""
The communication channel between test and test runner
"""
return
self
.
__runner_queue
def
set_runner_queue
(
self
,
runner_queue
):
"""
Override the runner_queue
"""
self
.
assertTrue
(
self
.
__runner_queue
is
None
,
"Overriding of runner_"
"queue multiple times is not allowed -> old=%s new=%s"
%
(
self
.
__runner_queue
,
runner_queue
))
self
.
__runner_queue
=
runner_queue
@
property
def
status
(
self
):
"""
...
...
@@ -428,9 +450,9 @@ class Test(unittest.TestCase):
"""
if
self
.
running
and
self
.
time_start
:
self
.
_update_time_elapsed
()
preserve_attr
=
[
'basedir'
,
'
debugdir'
,
'depsdir'
,
'
fail_reason'
,
'logdir'
,
'logfile'
,
'name'
,
'
resultsdir'
,
'
srcdir'
,
'status'
,
't
ext_output'
,
't
ime_elapsed'
,
preserve_attr
=
[
'basedir'
,
'fail_reason'
,
'logdir'
,
'logfile'
,
'name'
,
'srcdir'
,
'status'
,
'time_elapsed'
,
'traceback'
,
'workdir'
,
'whiteboard'
,
'time_start'
,
'time_end'
,
'running'
,
'paused'
,
'paused_msg'
,
'fail_class'
,
'params'
,
"timeout"
]
...
...
@@ -691,8 +713,6 @@ class Test(unittest.TestCase):
self
.
_tag_end
()
self
.
_report
()
self
.
log
.
info
(
""
)
with
open
(
self
.
logfile
,
'r'
)
as
log_file_obj
:
self
.
text_output
=
log_file_obj
.
read
()
self
.
_stop_logging
()
def
_report
(
self
):
...
...
avocado/plugins/xunit.py
浏览文件 @
39c994d1
...
...
@@ -61,7 +61,12 @@ class XUnitResult(Result):
traceback
=
document
.
createCDATASection
(
traceback_content
)
element
.
appendChild
(
traceback
)
system_out
=
Element
(
'system-out'
)
system_out_cdata_content
=
self
.
_escape_cdata
(
test
.
get
(
'text_output'
,
self
.
UNKNOWN
))
try
:
with
open
(
test
.
get
(
"logfile"
),
"r"
)
as
logfile_obj
:
text_output
=
logfile_obj
.
read
()
except
(
TypeError
,
IOError
):
text_output
=
self
.
UNKNOWN
system_out_cdata_content
=
self
.
_escape_cdata
(
text_output
)
system_out_cdata
=
document
.
createCDATASection
(
system_out_cdata_content
)
system_out
.
appendChild
(
system_out_cdata
)
element
.
appendChild
(
system_out
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录