Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
1d4bd66d
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,发现更多精彩内容 >>
提交
1d4bd66d
编写于
5月 28, 2014
作者:
L
Lucas Meneghel Rodrigues
提交者:
Lucas Meneghel Rodrigues
5月 28, 2014
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #74 from ruda/job_owns_start_file_logging
Job class owns execution of start_file_logging()
上级
4e66bdc6
0bb3c5f5
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
14 addition
and
19 deletion
+14
-19
avocado/job.py
avocado/job.py
+6
-2
avocado/plugins/jsonresult.py
avocado/plugins/jsonresult.py
+1
-4
avocado/plugins/vm.py
avocado/plugins/vm.py
+2
-2
avocado/result.py
avocado/result.py
+1
-6
selftests/all/unit/avocado/jsonresult_unittest.py
selftests/all/unit/avocado/jsonresult_unittest.py
+2
-3
selftests/all/unit/avocado/vm_unittest.py
selftests/all/unit/avocado/vm_unittest.py
+2
-2
未找到文件。
avocado/job.py
浏览文件 @
1d4bd66d
...
...
@@ -166,8 +166,6 @@ class Job(object):
else
:
test_result_class
=
result
.
HumanTestResult
if
self
.
args
is
not
None
:
self
.
args
.
test_result_debuglog
=
self
.
debuglog
self
.
args
.
test_result_loglevel
=
self
.
loglevel
self
.
args
.
test_result_total
=
len
(
urls
)
test_result
=
test_result_class
(
self
.
output_manager
,
self
.
args
)
return
test_result
...
...
@@ -223,7 +221,12 @@ class Job(object):
test_result
=
self
.
_make_test_result
(
params_list
)
self
.
test_runner
=
self
.
_make_test_runner
(
test_result
)
self
.
output_manager
.
start_file_logging
(
self
.
debuglog
,
self
.
loglevel
)
self
.
output_manager
.
debuglog
=
self
.
debuglog
failures
=
self
.
test_runner
.
run
(
params_list
)
self
.
output_manager
.
stop_file_logging
()
# If it's all good so far, set job status to 'PASS'
if
self
.
status
==
'RUNNING'
:
self
.
status
=
'PASS'
...
...
@@ -234,6 +237,7 @@ class Job(object):
if
self
.
args
.
archive
:
name
=
os
.
path
.
basename
(
self
.
debugdir
)
archive
.
create_zip
(
name
,
self
.
debugdir
)
tests_status
=
not
bool
(
failures
)
if
tests_status
:
return
error_codes
.
numeric_status
[
'AVOCADO_ALL_OK'
]
...
...
avocado/plugins/jsonresult.py
浏览文件 @
1d4bd66d
...
...
@@ -33,9 +33,7 @@ class JSONTestResult(TestResult):
Called once before any tests are executed.
"""
TestResult
.
start_tests
(
self
)
self
.
stream
.
start_file_logging
(
self
.
args
.
test_result_debuglog
,
self
.
args
.
test_result_loglevel
)
self
.
json
=
{
'debuglog'
:
self
.
args
.
test_result_debuglog
,
self
.
json
=
{
'debuglog'
:
self
.
stream
.
debuglog
,
'tests'
:
[]}
def
end_test
(
self
,
test
):
...
...
@@ -62,7 +60,6 @@ class JSONTestResult(TestResult):
Called once after all tests are executed.
"""
TestResult
.
end_tests
(
self
)
self
.
stream
.
stop_file_logging
()
self
.
json
.
update
({
'total'
:
self
.
tests_total
,
'pass'
:
len
(
self
.
passed
),
...
...
avocado/plugins/vm.py
浏览文件 @
1d4bd66d
...
...
@@ -78,7 +78,7 @@ class VMTestRunner(TestRunner):
if
not
status
.
mapping
[
test
.
status
]:
failures
.
append
(
test
.
tagged_name
)
self
.
result
.
end_tests
()
local_log_dir
=
os
.
path
.
dirname
(
self
.
result
.
args
.
test_result_
debuglog
)
local_log_dir
=
os
.
path
.
dirname
(
self
.
result
.
stream
.
debuglog
)
zip_filename
=
os
.
path
.
basename
(
remote_log_dir
)
+
'.zip'
zip_path_filename
=
os
.
path
.
join
(
local_log_dir
,
zip_filename
)
self
.
result
.
vm
.
remote
.
receive_files
(
local_log_dir
,
zip_filename
)
...
...
@@ -172,7 +172,7 @@ class VMTestResult(TestResult):
self
.
stream
.
log_header
(
"TOTAL SKIPPED: %d"
%
len
(
self
.
skipped
))
self
.
stream
.
log_header
(
"TOTAL WARNED: %d"
%
len
(
self
.
warned
))
self
.
stream
.
log_header
(
"ELAPSED TIME: %.2f s"
%
self
.
total_time
)
self
.
stream
.
log_header
(
"DEBUG LOG: %s"
%
self
.
args
.
test_result_
debuglog
)
self
.
stream
.
log_header
(
"DEBUG LOG: %s"
%
self
.
stream
.
debuglog
)
def
start_test
(
self
,
test
):
"""
...
...
avocado/result.py
浏览文件 @
1d4bd66d
...
...
@@ -138,10 +138,7 @@ class HumanTestResult(TestResult):
Called once before any tests are executed.
"""
TestResult
.
start_tests
(
self
)
if
hasattr
(
self
.
args
,
'test_result_debuglog'
):
self
.
stream
.
start_file_logging
(
self
.
args
.
test_result_debuglog
,
self
.
args
.
test_result_loglevel
)
self
.
stream
.
log_header
(
"DEBUG LOG: %s"
%
self
.
args
.
test_result_debuglog
)
self
.
stream
.
log_header
(
"DEBUG LOG: %s"
%
self
.
stream
.
debuglog
)
self
.
stream
.
log_header
(
"TOTAL TESTS: %s"
%
self
.
tests_total
)
def
end_tests
(
self
):
...
...
@@ -154,8 +151,6 @@ class HumanTestResult(TestResult):
self
.
stream
.
log_header
(
"TOTAL SKIPPED: %d"
%
len
(
self
.
skipped
))
self
.
stream
.
log_header
(
"TOTAL WARNED: %d"
%
len
(
self
.
warned
))
self
.
stream
.
log_header
(
"ELAPSED TIME: %.2f s"
%
self
.
total_time
)
if
hasattr
(
self
.
args
,
'test_result_debuglog'
):
self
.
stream
.
stop_file_logging
()
def
start_test
(
self
,
test
):
"""
...
...
selftests/all/unit/avocado/jsonresult_unittest.py
浏览文件 @
1d4bd66d
...
...
@@ -47,10 +47,9 @@ class JSONResultTest(unittest.TestCase):
def
setUp
(
self
):
self
.
tmpfile
=
mkstemp
()
args
=
argparse
.
Namespace
(
json_output
=
self
.
tmpfile
[
1
],
test_result_debuglog
=
'debuglog'
,
test_result_loglevel
=
'loglevel'
)
args
=
argparse
.
Namespace
(
json_output
=
self
.
tmpfile
[
1
])
stream
=
_Stream
()
stream
.
debuglog
=
'debuglog'
self
.
test_result
=
jsonresult
.
JSONTestResult
(
stream
,
args
)
self
.
test_result
.
filename
=
self
.
tmpfile
[
1
]
self
.
test_result
.
start_tests
()
...
...
selftests/all/unit/avocado/vm_unittest.py
浏览文件 @
1d4bd66d
...
...
@@ -48,9 +48,9 @@ class _Stream(object):
class
VMResultTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
args
=
argparse
.
Namespace
(
test_result_debuglog
=
'debuglog'
,
test_result_loglevel
=
'loglevel'
)
args
=
argparse
.
Namespace
()
stream
=
_Stream
()
stream
.
debuglog
=
'debuglog'
self
.
test_result
=
vm
.
VMTestResult
(
stream
,
args
)
j
=
'''{"tests": [{"test": "sleeptest.1", "url": "sleeptest", "status": "PASS", "time": 1.23}],
"debuglog": "/home/user/avocado/logs/run-2014-05-26-15.45.37/debug.log",
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录