Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
c50d6b4b
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
c50d6b4b
编写于
8月 04, 2020
作者:
C
Cleber Rosa
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'richtja/loader_incom_v4'
Signed-off-by:
N
Cleber Rosa
<
crosa@redhat.com
>
上级
3403508a
76f103bc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
39 addition
and
3 deletion
+39
-3
avocado/core/loader.py
avocado/core/loader.py
+5
-0
docs/source/guides/user/chapters/introduction.rst
docs/source/guides/user/chapters/introduction.rst
+4
-0
docs/source/guides/user/chapters/loaders.rst
docs/source/guides/user/chapters/loaders.rst
+4
-2
selftests/functional/test_loader.py
selftests/functional/test_loader.py
+26
-1
未找到文件。
avocado/core/loader.py
浏览文件 @
c50d6b4b
...
...
@@ -23,6 +23,7 @@ import os
import
re
import
shlex
import
sys
import
warnings
from
enum
import
Enum
from
..utils
import
stacktrace
...
...
@@ -123,6 +124,10 @@ class TestLoaderProxy:
if
external_runner
:
self
.
register_plugin
(
ExternalLoader
)
key
=
"{}.loaders"
.
format
(
subcommand
)
if
set
(
config
[
key
])
!=
{
'file'
,
'@DEFAULT'
}:
warnings
.
warn
(
"The loaders and external-runner are incompatible."
"The values in loaders will be ignored."
,
RuntimeWarning
)
config
[
key
]
=
[
"external:{}"
.
format
(
external_runner
)]
else
:
# Add (default) file loader if not already registered
...
...
docs/source/guides/user/chapters/introduction.rst
浏览文件 @
c50d6b4b
...
...
@@ -215,6 +215,10 @@ But now consider the following example::
This effectively makes `/bin/curl` an "external test runner", responsible for
trying to fetch those URLs, and reporting PASS or FAIL for each of them.
.. warning:: The external runner is incompatible with loaders from
:ref:`test-loaders`. If you use external runner and loader together
the job will use the external runner and ignore the loader.
Runner outputs
--------------
...
...
docs/source/guides/user/chapters/loaders.rst
浏览文件 @
c50d6b4b
Undestanding the test discovery (Avocado Loaders)
=================================================
.. _test-loaders:
Understanding the test discovery (Avocado Loaders)
==================================================
In this section you can learn how tests are being discovered and how to
customize this process.
...
...
selftests/functional/test_loader.py
浏览文件 @
c50d6b4b
...
...
@@ -9,7 +9,8 @@ import unittest
from
avocado.core
import
exit_codes
from
avocado.utils
import
process
,
script
from
..
import
AVOCADO
,
BASEDIR
,
TestCaseTmpDir
,
skipOnLevelsInferiorThan
from
..
import
(
AVOCADO
,
BASEDIR
,
TestCaseTmpDir
,
skipOnLevelsInferiorThan
,
skipUnlessPathExists
)
AVOCADO_TEST_OK
=
"""#!/usr/bin/env python
from avocado import Test
...
...
@@ -296,6 +297,30 @@ class LoaderTestFunctional(TestCaseTmpDir):
b
"SIMPLE examples/tests/failtest.sh
\n
"
)
self
.
assertEqual
(
expected
,
result
.
stdout
)
@
skipUnlessPathExists
(
'/bin/sh'
)
def
test_loader_and_external_runner_incompatibility
(
self
):
"""
Check if the user is inform about incompatibility between loader and
external_runner.
"""
test_script
=
script
.
TemporaryScript
(
'simpletest.sh'
,
SIMPLE_TEST
,
'avocado_loader_test'
,
mode
=
self
.
MODE_0775
)
test_script
.
save
()
cmd
=
(
"%s run --loaders=FOO "
"--external-runner=/bin/sh %s"
)
%
(
AVOCADO
,
test_script
.
path
)
result
=
process
.
run
(
cmd
)
expected_warning
=
(
"The loaders and external-runner are incompatible."
"The values in loaders will be ignored."
)
self
.
assertIn
(
expected_warning
,
result
.
stderr_text
)
cmd
=
"%s run --external-runner=/bin/sh %s"
%
(
AVOCADO
,
test_script
.
path
)
result
=
process
.
run
(
cmd
)
self
.
assertNotIn
(
expected_warning
,
result
.
stderr_text
)
test_script
.
remove
()
if
__name__
==
'__main__'
:
unittest
.
main
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录