diff --git a/.travis.yml b/.travis.yml index 516b00f..c769ffa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,11 +7,18 @@ matrix: dist: trusty - python: 2.7 - python: 3.6 + env: aptpkgs=python3-selinux - python: 3.7 - python: 3.7-dev - python: 3.8-dev # - python: nightly +services: + - docker + +before_install: + - if [ -n "${aptpkgs}" ]; then sudo apt-get install -y python3-selinux; fi + install: - pip install tox tox-travis diff --git a/tox.ini b/tox.ini index 11bd949..50a5482 100644 --- a/tox.ini +++ b/tox.ini @@ -4,12 +4,16 @@ skipsdist = true skip_missing_interpreters = True [testenv] -basepython = python2.7 +basepython = python3 deps = py{26,27,36,37,38}: pytest-cov py{27,36,37,38}: pytest>=3.5.1 py{26,27}: mock py26: pytest + molecule_{lint,syntax,test}: docker + molecule_{lint,syntax,test}: jmespath + molecule_{lint,syntax,test}: molecule + molecule_{lint,syntax,test}: selinux [base] passenv = * @@ -21,17 +25,16 @@ covtarget = {toxinidir}/library --cov {toxinidir}/module_utils pytesttarget = . [testenv:black] -basepython = python3.6 deps = black commands = black --check --diff --include "^[^.].*\.py$" . [testenv:py26] +basepython = python2.6 passenv = {[base]passenv} setenv = {[base]setenv} changedir = {[base]changedir} -basepython = python2.6 commands = pytest \ --durations=5 \ @@ -41,11 +44,11 @@ commands = {[base]pytesttarget} [testenv:py27] +basepython = python2.7 passenv = {[base]passenv} setenv = {[base]setenv} changedir = {[base]changedir} -basepython = python2.7 commands = pytest \ --durations=5 \ @@ -55,11 +58,11 @@ commands = {[base]pytesttarget} [testenv:py36] +basepython = python3.6 passenv = {[base]passenv} setenv = {[base]setenv} changedir = {[base]changedir} -basepython = python3.6 commands = pytest \ --durations=5 \ @@ -69,11 +72,11 @@ commands = {[base]pytesttarget} [testenv:py37] +basepython = python3.7 passenv = {[base]passenv} setenv = {[base]setenv} changedir = {[base]changedir} -basepython = python3.7 commands = pytest \ --durations=5 \ @@ -112,6 +115,7 @@ commands = tests/test_network_connections.py [testenv:flake8] +basepython = python2.7 deps = flake8>=3.5 whitelist_externals = flake8 @@ -120,6 +124,7 @@ commands= . [testenv:coveralls] +basepython = python2.7 passenv = TRAVIS TRAVIS_* deps = coveralls @@ -128,12 +133,23 @@ commands = coveralls [testenv:ensure_non_running_provider] -basepython = python3.6 deps = PyYAML changedir = {toxinidir}/tests commands = {toxinidir}/tests/ensure_non_running_provider.py +[testenv:molecule_lint] +commands_pre = + molecule --version + ansible --version +commands = molecule {posargs} lint + +[testenv:molecule_syntax] +commands = molecule {posargs} syntax + +[testenv:molecule_test] +commands = molecule {posargs} test + [pytest] addopts = -rxs @@ -153,6 +169,6 @@ max-line-length = 88 python = 2.6: py26 2.7: py27,coveralls,flake8,pylint - 3.6: py36,black,ensure_non_running_provider + 3.6: py36,black,ensure_non_running_provider,molecule_lint,molecule_syntax,molecule_test 3.7: py37 3.8: py38