Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
da4c8478
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,发现更多精彩内容 >>
提交
da4c8478
编写于
1月 25, 2016
作者:
C
Cleber Rosa
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'apahim/rename_testna'
上级
12e57a6b
205a2f91
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
24 addition
and
18 deletion
+24
-18
avocado/core/exceptions.py
avocado/core/exceptions.py
+3
-3
avocado/core/html.py
avocado/core/html.py
+1
-1
avocado/core/result.py
avocado/core/result.py
+1
-1
avocado/core/status.py
avocado/core/status.py
+8
-1
avocado/core/test.py
avocado/core/test.py
+6
-6
avocado/core/xunit.py
avocado/core/xunit.py
+1
-1
avocado/plugins/replay.py
avocado/plugins/replay.py
+2
-2
docs/source/ReferenceGuide.rst
docs/source/ReferenceGuide.rst
+1
-1
selftests/functional/test_replay.py
selftests/functional/test_replay.py
+1
-2
未找到文件。
avocado/core/exceptions.py
浏览文件 @
da4c8478
...
...
@@ -157,16 +157,16 @@ class TestAbortError(TestBaseException):
status
=
"ERROR"
class
Test
NA
Error
(
TestBaseException
):
class
Test
Skip
Error
(
TestBaseException
):
"""
Indictates that the test is
Not Applicable
.
Indictates that the test is
skipped
.
Should be thrown when various conditions are such that the test is
inappropriate. For example, inappropriate architecture, wrong OS version,
program being tested does not have the expected capability (older version).
"""
status
=
"
TEST_NA
"
status
=
"
SKIP
"
class
TestFail
(
TestBaseException
,
AssertionError
):
...
...
avocado/core/html.py
浏览文件 @
da4c8478
...
...
@@ -114,7 +114,7 @@ class ReportModel(object):
@
property
def
tests
(
self
):
mapping
=
{
"
TEST_NA
"
:
"warning"
,
mapping
=
{
"
SKIP
"
:
"warning"
,
"ABORT"
:
"danger"
,
"ERROR"
:
"danger"
,
"FAIL"
:
"danger"
,
...
...
avocado/core/result.py
浏览文件 @
da4c8478
...
...
@@ -243,7 +243,7 @@ class TestResult(object):
status_map
=
{
'PASS'
:
self
.
add_pass
,
'ERROR'
:
self
.
add_error
,
'FAIL'
:
self
.
add_fail
,
'
TEST_NA
'
:
self
.
add_skip
,
'
SKIP
'
:
self
.
add_skip
,
'WARN'
:
self
.
add_warn
,
'INTERRUPTED'
:
self
.
add_interrupt
}
add
=
status_map
[
state
[
'status'
]]
...
...
avocado/core/status.py
浏览文件 @
da4c8478
...
...
@@ -16,7 +16,7 @@ This is used by methods and functions to return a cut and dry answer to wether
a test or a job in avocado PASSed or FAILed.
"""
mapping
=
{
"
TEST_NA
"
:
True
,
mapping
=
{
"
SKIP
"
:
True
,
"ABORT"
:
False
,
"ERROR"
:
False
,
"FAIL"
:
False
,
...
...
@@ -28,6 +28,13 @@ mapping = {"TEST_NA": True,
"NOSTATUS"
:
False
,
"INTERRUPTED"
:
False
}
user_facing_status
=
[
"SKIP"
,
"ERROR"
,
"FAIL"
,
"WARN"
,
"PASS"
,
"INTERRUPTED"
]
feedback
=
{
# Test did not advertise current status, but process running the test is
# known to be still running
...
...
avocado/core/test.py
浏览文件 @
da4c8478
...
...
@@ -352,16 +352,16 @@ class Test(unittest.TestCase):
stderr_check_exception
=
None
try
:
self
.
setUp
()
except
exceptions
.
Test
NA
Error
,
details
:
except
exceptions
.
Test
Skip
Error
,
details
:
stacktrace
.
log_exc_info
(
sys
.
exc_info
(),
logger
=
'avocado.test'
)
raise
exceptions
.
Test
NA
Error
(
details
)
raise
exceptions
.
Test
Skip
Error
(
details
)
except
:
# Old-style exceptions are not inherited from Exception()
stacktrace
.
log_exc_info
(
sys
.
exc_info
(),
logger
=
'avocado.test'
)
details
=
sys
.
exc_info
()[
1
]
raise
exceptions
.
TestSetupFail
(
details
)
try
:
testMethod
()
except
exceptions
.
Test
NA
Error
,
details
:
except
exceptions
.
Test
Skip
Error
,
details
:
stacktrace
.
log_exc_info
(
sys
.
exc_info
(),
logger
=
'avocado.test'
)
skip_illegal_msg
=
(
'Calling skip() in places other than '
'setUp() is not allowed in avocado, you '
...
...
@@ -377,7 +377,7 @@ class Test(unittest.TestCase):
finally
:
try
:
self
.
tearDown
()
except
exceptions
.
Test
NA
Error
,
details
:
except
exceptions
.
Test
Skip
Error
,
details
:
stacktrace
.
log_exc_info
(
sys
.
exc_info
(),
logger
=
'avocado.test'
)
skip_illegal_msg
=
(
'Calling skip() in places other than '
'setUp() is not allowed in avocado, '
...
...
@@ -544,7 +544,7 @@ class Test(unittest.TestCase):
:param message: an optional message that will be recorded in the logs
:type message: str
"""
raise
exceptions
.
Test
NA
Error
(
message
)
raise
exceptions
.
Test
Skip
Error
(
message
)
class
SimpleTest
(
Test
):
...
...
@@ -681,7 +681,7 @@ class TimeOutSkipTest(Test):
_skip_reason
=
"Test skipped due a job timeout!"
def
setUp
(
self
):
raise
exceptions
.
Test
NA
Error
(
self
.
_skip_reason
)
raise
exceptions
.
Test
Skip
Error
(
self
.
_skip_reason
)
def
test
(
self
):
raise
NotImplementedError
(
"This should never be executed!"
)
...
...
avocado/core/xunit.py
浏览文件 @
da4c8478
...
...
@@ -189,7 +189,7 @@ class xUnitTestResult(TestResult):
TestResult
.
end_test
(
self
,
state
)
if
state
[
'status'
]
in
(
'PASS'
,
'WARN'
):
self
.
xml
.
add_success
(
state
)
elif
state
[
'status'
]
==
'
TEST_NA
'
:
elif
state
[
'status'
]
==
'
SKIP
'
:
self
.
xml
.
add_skip
(
state
)
elif
state
[
'status'
]
==
'FAIL'
:
self
.
xml
.
add_failure
(
state
)
...
...
avocado/plugins/replay.py
浏览文件 @
da4c8478
...
...
@@ -66,10 +66,10 @@ class Replay(CLI):
def
_valid_status
(
self
,
string
):
status_list
=
string
.
split
(
','
)
for
item
in
status_list
:
if
item
not
in
status
.
mapping
:
if
item
not
in
status
.
user_facing_status
:
msg
=
'Invalid --replay-test-status option. Valid '
\
'options are (more than one allowed): %s'
%
\
','
.
join
([
item
for
item
in
status
.
mapping
])
','
.
join
([
item
for
item
in
status
.
user_facing_status
])
raise
argparse
.
ArgumentTypeError
(
msg
)
return
status_list
...
...
docs/source/ReferenceGuide.rst
浏览文件 @
da4c8478
...
...
@@ -44,7 +44,7 @@ as a simple test.
The instrumented tests allows the writer finer control over the process
including logging, test result status and other more sophisticated test APIs.
Test statuses ``PASS``, ``WARN``, ``START`` and ``
TEST_NA
`` are considered as
Test statuses ``PASS``, ``WARN``, ``START`` and ``
SKIP
`` are considered as
successful builds. The ``ABORT``, ``ERROR``, ``FAIL``, ``ALERT``, ``RUNNING``,
``NOSTATUS`` and ``INTERRUPTED`` are considered as failed ones.
...
...
selftests/functional/test_replay.py
浏览文件 @
da4c8478
...
...
@@ -97,8 +97,7 @@ class ReplayTests(unittest.TestCase):
expected_rc
=
exit_codes
.
AVOCADO_JOB_FAIL
result
=
self
.
run_and_check
(
cmd_line
,
expected_rc
)
msg
=
'Invalid --replay-test-status option. Valid options are (more '
\
'than one allowed): NOSTATUS,INTERRUPTED,WARN,START,ERROR,'
\
'FAIL,PASS,TEST_NA,ALERT,RUNNING,ABORT'
'than one allowed): SKIP,ERROR,FAIL,WARN,PASS,INTERRUPTED'
self
.
assertIn
(
msg
,
result
.
stderr
)
def
test_run_replay_statusfail
(
self
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录