Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
30630454
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,发现更多精彩内容 >>
未验证
提交
30630454
编写于
11月 26, 2018
作者:
C
Cleber Rosa
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'ldoktor/xunit-float'
Signed-off-by:
N
Cleber Rosa
<
crosa@redhat.com
>
上级
d3487744
c6675fb3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
2 deletion
+11
-2
avocado/plugins/xunit.py
avocado/plugins/xunit.py
+2
-2
selftests/unit/test_xunit.py
selftests/unit/test_xunit.py
+9
-0
未找到文件。
avocado/plugins/xunit.py
浏览文件 @
30630454
...
@@ -71,12 +71,12 @@ class XUnitResult(Result):
...
@@ -71,12 +71,12 @@ class XUnitResult(Result):
if
log_size
<
max_log_size
:
if
log_size
<
max_log_size
:
text_output
=
logfile_obj
.
read
()
text_output
=
logfile_obj
.
read
()
else
:
else
:
size
=
max_log_size
/
2
size
=
int
(
max_log_size
/
2
)
logfile_obj
.
seek
(
0
,
0
)
logfile_obj
.
seek
(
0
,
0
)
text_output
=
logfile_obj
.
read
(
size
)
text_output
=
logfile_obj
.
read
(
size
)
text_output
+=
(
"
\n\n
--[ CUT DUE TO XML PER TEST "
text_output
+=
(
"
\n\n
--[ CUT DUE TO XML PER TEST "
"LIMIT ]--
\n\n
"
)
"LIMIT ]--
\n\n
"
)
logfile_obj
.
seek
(
-
size
/
2
,
2
)
logfile_obj
.
seek
(
log_size
-
size
,
0
)
text_output
+=
logfile_obj
.
read
()
text_output
+=
logfile_obj
.
read
()
else
:
else
:
text_output
=
logfile_obj
.
read
()
text_output
=
logfile_obj
.
read
()
...
...
selftests/unit/test_xunit.py
浏览文件 @
30630454
...
@@ -97,6 +97,7 @@ class xUnitSucceedTest(unittest.TestCase):
...
@@ -97,6 +97,7 @@ class xUnitSucceedTest(unittest.TestCase):
def
test_max_test_log_size
(
self
):
def
test_max_test_log_size
(
self
):
log
=
tempfile
.
NamedTemporaryFile
(
dir
=
self
.
tmpdir
,
delete
=
False
)
log
=
tempfile
.
NamedTemporaryFile
(
dir
=
self
.
tmpdir
,
delete
=
False
)
log_content
=
b
"1234567890"
*
100
log_content
=
b
"1234567890"
*
100
log_content
+=
b
"this should not be present"
+
b
"0987654321"
*
100
log
.
write
(
log_content
)
log
.
write
(
log_content
)
log_path
=
log
.
name
log_path
=
log
.
name
log
.
close
()
log
.
close
()
...
@@ -117,6 +118,14 @@ class xUnitSucceedTest(unittest.TestCase):
...
@@ -117,6 +118,14 @@ class xUnitSucceedTest(unittest.TestCase):
"Length of xunit limitted to 10 chars was greater "
"Length of xunit limitted to 10 chars was greater "
"than (unlimited - 500). Unlimited output:
\n
%s
\n\n
"
"than (unlimited - 500). Unlimited output:
\n
%s
\n\n
"
"Limited output:
\n
%s"
%
(
unlimited
,
limited
))
"Limited output:
\n
%s"
%
(
unlimited
,
limited
))
self
.
assertIn
(
b
"this should not be present"
,
unlimited
)
self
.
assertNotIn
(
b
"this should not be present"
,
limited
)
self
.
assertIn
(
b
"1234567890"
,
unlimited
)
self
.
assertNotIn
(
b
"1234567890"
,
limited
)
self
.
assertIn
(
b
"12345"
,
limited
)
self
.
assertIn
(
b
"0987654321"
,
unlimited
)
self
.
assertNotIn
(
b
"0987654321"
,
limited
)
self
.
assertIn
(
b
"54321"
,
limited
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录