提交 494405ae 编写于 作者: C Cleber Rosa

Python 3: do not allow failures on CI, but only run unittests and doc

This removes the exception of allowing failures on the Travis CI jobs
with Python 3, while, at the same time, temporary restricts Python 3
jobs to run only unittests and the documentation build for the Avocado
core.  That is, it excludes the functional tests, and the optional
plugin's tests.

While it may look like a step back, it's actually a step forward in the
Python 3 port, because now any regression on the unittests will be caught.
And, when the additional fixes are applied to address the functional tests
and plugin's tests, the whole set of tests will be enabled for Python 3.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 1c6d79dd
......@@ -7,10 +7,6 @@ python:
- "2.7"
- "3.4"
matrix:
allow_failures:
- python: "3.4"
branches:
only:
- master
......
......@@ -24,14 +24,19 @@ parallel_selftests() {
local ERR=0
local FIND_UNITTESTS=$(readlink -f ./contrib/scripts/avocado-find-unittests)
local NO_WORKERS=$(($(cat /proc/cpuinfo | grep -c processor) * 2))
local PY3=$(python --version 2>&1 | grep -q "$Python 3\.")$?
# The directories that may contain files with tests, from the Avocado core
# and from all optional plugins
declare -A DIR_GLOB_MAP
DIR_GLOB_MAP[selftests]="selftests/unit/test_*.py selftests/functional/test_*.py selftests/doc/test_*.py"
for PLUGIN in $(find optional_plugins -mindepth 1 -maxdepth 1 -type d); do
DIR_GLOB_MAP[$PLUGIN]="tests/test_*.py"
done;
if [ $PY3 -eq 1 ]; then
DIR_GLOB_MAP[selftests]="selftests/unit/test_*.py selftests/functional/test_*.py selftests/doc/test_*.py"
for PLUGIN in $(find optional_plugins -mindepth 1 -maxdepth 1 -type d); do
DIR_GLOB_MAP[$PLUGIN]="tests/test_*.py"
done;
else
DIR_GLOB_MAP[selftests]="selftests/unit/test_*.py selftests/doc/test_*.py"
fi
declare -A TESTS
for TEST_DIR in "${!DIR_GLOB_MAP[@]}"; do
......
......@@ -30,9 +30,15 @@ def test_suite():
loader = unittest.TestLoader()
selftests_dir = os.path.dirname(os.path.abspath(__file__))
basedir = os.path.dirname(selftests_dir)
for section in ('unit', 'functional', 'doc'):
if sys.version_info[0] == 3:
sections = ('unit', 'doc')
else:
sections = ('unit', 'functional', 'doc')
for section in sections:
suite.addTests(loader.discover(start_dir=os.path.join(selftests_dir, section),
top_level_dir=basedir))
if sys.version_info[0] == 3:
return suite
plugins = (('avocado-framework-plugin-varianter-yaml-to-mux',
'varianter_yaml_to_mux'),
('avocado-framework-plugin-runner-remote',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册