Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
fa0eeb90
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,发现更多精彩内容 >>
提交
fa0eeb90
编写于
9月 29, 2016
作者:
A
Amador Pahim
提交者:
GitHub
9月 29, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1491 from clebergnu/handle_result_plugin_failures
Handle result plugin failures / HTML result fix with older pystache
上级
3d7f38c1
9137db51
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
5 deletion
+18
-5
avocado/core/dispatcher.py
avocado/core/dispatcher.py
+15
-1
avocado/core/job.py
avocado/core/job.py
+2
-2
optional_plugins/html/avocado_result_html/__init__.py
optional_plugins/html/avocado_result_html/__init__.py
+1
-2
未找到文件。
avocado/core/dispatcher.py
浏览文件 @
fa0eeb90
...
...
@@ -75,7 +75,7 @@ class JobPrePostDispatcher(Dispatcher):
def
__init__
(
self
):
super
(
JobPrePostDispatcher
,
self
).
__init__
(
'avocado.plugins.job.prepost'
)
def
map_method
s
(
self
,
method_name
,
job
):
def
map_method
(
self
,
method_name
,
job
):
for
ext
in
self
.
extensions
:
try
:
if
hasattr
(
ext
.
obj
,
method_name
):
...
...
@@ -94,3 +94,17 @@ class ResultDispatcher(Dispatcher):
def
__init__
(
self
):
super
(
ResultDispatcher
,
self
).
__init__
(
'avocado.plugins.result'
)
def
map_method
(
self
,
method_name
,
result
,
job
):
for
ext
in
self
.
extensions
:
try
:
if
hasattr
(
ext
.
obj
,
method_name
):
method
=
getattr
(
ext
.
obj
,
method_name
)
method
(
result
,
job
)
except
SystemExit
:
raise
except
KeyboardInterrupt
:
raise
except
:
job
.
log
.
error
(
'Error running method "%s" of plugin "%s": %s'
,
method_name
,
ext
.
name
,
sys
.
exc_info
()[
1
])
avocado/core/job.py
浏览文件 @
fa0eeb90
...
...
@@ -433,7 +433,7 @@ class Job(object):
self
.
_remove_job_results
()
raise
exceptions
.
OptionValidationError
(
details
)
self
.
job_pre_post_dispatcher
.
map_method
s
(
'pre'
,
self
)
self
.
job_pre_post_dispatcher
.
map_method
(
'pre'
,
self
)
if
not
self
.
test_suite
:
self
.
_remove_job_results
()
...
...
@@ -527,7 +527,7 @@ class Job(object):
self
.
exitcode
|=
exit_codes
.
AVOCADO_FAIL
return
self
.
exitcode
finally
:
self
.
job_pre_post_dispatcher
.
map_method
s
(
'post'
,
self
)
self
.
job_pre_post_dispatcher
.
map_method
(
'post'
,
self
)
if
not
settings
.
get_value
(
'runner.behavior'
,
'keep_tmp_files'
,
key_type
=
bool
,
default
=
False
):
data_dir
.
clean_tmp_files
()
...
...
optional_plugins/html/avocado_result_html/__init__.py
浏览文件 @
fa0eeb90
...
...
@@ -248,8 +248,7 @@ class HTMLResult(Result):
else
:
from
pystache
import
view
v
=
view
.
View
(
template
,
context
)
report_contents
=
v
.
render
(
'utf8'
)
# encodes into ascii
report_contents
=
codecs
.
decode
(
"utf8"
)
# decode to unicode
report_contents
=
v
.
render
(
'utf8'
)
except
UnicodeDecodeError
as
details
:
# FIXME: Remove me when UnicodeDecodeError problem is fixed
import
logging
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录