From 7ab4a889ad6c1f6bce301328182701cc2a02fb60 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Fri, 30 Jun 2017 14:53:32 -0700 Subject: [PATCH] Update tox.ini to use ansible-test. --- test/runner/test.py | 6 +++--- test/utils/tox/requirements-py3.txt | 16 ---------------- test/utils/tox/requirements.txt | 18 ------------------ tox.ini | 24 +++++++++++------------- 4 files changed, 14 insertions(+), 50 deletions(-) delete mode 100644 test/utils/tox/requirements-py3.txt delete mode 100644 test/utils/tox/requirements.txt diff --git a/test/runner/test.py b/test/runner/test.py index da62e531446..13a3c485b67 100755 --- a/test/runner/test.py +++ b/test/runner/test.py @@ -182,7 +182,7 @@ def parse_args(): integration.add_argument('--python', metavar='VERSION', - choices=SUPPORTED_PYTHON_VERSIONS, + choices=SUPPORTED_PYTHON_VERSIONS + ('default',), help='python version: %s' % ', '.join(SUPPORTED_PYTHON_VERSIONS)) integration.add_argument('--start-at', @@ -281,7 +281,7 @@ def parse_args(): compiler.add_argument('--python', metavar='VERSION', - choices=COMPILE_PYTHON_VERSIONS, + choices=COMPILE_PYTHON_VERSIONS + ('default',), help='python version: %s' % ', '.join(COMPILE_PYTHON_VERSIONS)) add_lint(compiler) @@ -313,7 +313,7 @@ def parse_args(): sanity.add_argument('--python', metavar='VERSION', - choices=SUPPORTED_PYTHON_VERSIONS, + choices=SUPPORTED_PYTHON_VERSIONS + ('default',), help='python version: %s' % ', '.join(SUPPORTED_PYTHON_VERSIONS)) sanity.add_argument('--base-branch', diff --git a/test/utils/tox/requirements-py3.txt b/test/utils/tox/requirements-py3.txt deleted file mode 100644 index 25a925a5774..00000000000 --- a/test/utils/tox/requirements-py3.txt +++ /dev/null @@ -1,16 +0,0 @@ -# -# Test requirements -# - -nose -mock >= 1.0.1, < 1.1 -passlib -coverage -coveralls -unittest2 -redis -python3-memcached -python-systemd -botocore -boto3 -pytest diff --git a/test/utils/tox/requirements.txt b/test/utils/tox/requirements.txt deleted file mode 100644 index ca3dd4fe931..00000000000 --- a/test/utils/tox/requirements.txt +++ /dev/null @@ -1,18 +0,0 @@ -# -# Test requirements -# - -nose -mock >= 1.0.1, < 1.1 -passlib -coverage -coveralls -unittest2 -redis -python-memcached -python-systemd -cryptography -pycrypto -botocore -boto3 -pytest diff --git a/tox.ini b/tox.ini index e5754b30413..2e936c49659 100644 --- a/tox.ini +++ b/tox.ini @@ -1,26 +1,24 @@ [tox] envlist = py26,py27,py35,py36 -[testenv:py35] -deps = -r{toxinidir}/test/utils/tox/requirements-py3.txt - -[testenv:py36] -deps = -r{toxinidir}/test/utils/tox/requirements-py3.txt - [testenv] -deps = -r{toxinidir}/test/utils/tox/requirements.txt -whitelist_externals = make +deps = -c{toxinidir}/test/runner/requirements/constraints.txt + -r{toxinidir}/test/runner/requirements/ansible-test.txt + -r{toxinidir}/test/runner/requirements/sanity.txt + -r{toxinidir}/test/runner/requirements/units.txt commands = python --version - py26: python -m compileall -fq -x 'test/samples|contrib/inventory/vagrant.py' lib test contrib - py27: python -m compileall -fq -x 'test/samples' lib test contrib - py3{5,6}: python -m compileall -fq -x 'test/samples|lib/ansible/modules' lib test contrib - make tests + # The recommended method of running tests with tox is to execute + # ansible-test directly and use the --tox and --python options. + # The commands below are provided as a convenience for those who + # prefer to run tox directly instead of through ansible-test. + {toxinidir}/test/runner/ansible-test compile --python default -v + {toxinidir}/test/runner/ansible-test sanity --python default -v + {toxinidir}/test/runner/ansible-test units --python default -v passenv = # Pass HOME to the test environment to avoid the missing HOME env # variable error. See issue: #20424 HOME - TEST_FLAGS [flake8]