From 6c293e8464aaafb6291c4e5a45cbf8559a812ffc Mon Sep 17 00:00:00 2001 From: Matt Phillips Date: Tue, 12 Mar 2019 16:59:15 -0400 Subject: [PATCH] let tox test multiple salt versions, both cherrypy and tornado backends --- .travis.yml | 36 +++++++++++++++++++++--------------- tests/requirements.txt | 1 - tox.ini | 11 ++++++++--- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7488b69..df4016e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,23 +12,29 @@ before_install: install: - pip install tox -matrix: - include: - - env: TOXENV=27,coverage CODECOV=py - python: 2.7 - - env: TOXENV=34,coverage CODECOV=py - python: 3.4 - - env: TOXENV=35,coverage CODECOV=py - python: 3.5 - - env: TOXENV=36,coverage CODECOV=py - python: 3.6 - - env: TOXENV=37,coverage CODECOV=py - python: 3.7-dev - - env: TOXENV=flake8 - python: 3.6 +env: + - PY=py27 + - PY=py34 + - PY=py35 + - PY=py36 + - PY=py37 + - SALT=v2017.7.9 + - SALT=v2018.8.4 + - SALT=v2019.2.0 + - BACKEND=cherrypy + - BACKEND=tornado script: -- docker run -v $PWD:/pepper -ti --rm gtmanfred/pepper:latest tox -c /pepper/tox.ini -e "${CODECOV}${TOXENV}" + - docker run -v $PWD:/pepper -ti --rm gtmanfred/pepper:latest tox -c /pepper/tox.ini -e "${PY}-${BACKEND}-${SALT}" + +jobs: + include: + - stage: test + python: 2.7 + script: docker run -v $PWD:/pepper -ti --rm gtmanfred/pepper:latest tox -c /pepper/tox.ini -e flake8 + - stage: test + python: 2.7 + script: docker run -v $PWD:/pepper -ti --rm gtmanfred/pepper:latest tox -c /pepper/tox.ini -e coverage after_success: - sudo chown $USER .tox/ diff --git a/tests/requirements.txt b/tests/requirements.txt index 5b1880b..a7a1c98 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -4,6 +4,5 @@ pytest-rerunfailures pytest-cov git+https://github.com/saltstack/pytest-salt@master#egg=pytest-salt tornado<5.0.0 -salt CherryPy setuptools_scm diff --git a/tox.ini b/tox.ini index f10b250..d6ce4a5 100644 --- a/tox.ini +++ b/tox.ini @@ -1,16 +1,21 @@ [tox] -envlist = py{27,34,35,36}-rest_{cherrypy,tornado},coverage,flake8 +envlist = py{27,34,35,36}-{cherrypy,tornado}-{v2017.7.9,v2018.3.4,v2019.2.0},coverage,flake8 skip_missing_interpreters = true skipsdist = false [testenv] passenv = TOXENV CI TRAVIS TRAVIS_* CODECOV_* deps = -r{toxinidir}/tests/requirements.txt + v2017.7.9: salt==2017.7.9 + v2018.3.4: salt==2018.3.4 + v2019.2.0: salt==2019.2.0 + develop: git+https://github.com/saltstack/salt.git@develop#egg=salt + changedir = {toxinidir} setenv = COVERAGE_FILE = {toxworkdir}/.coverage.{envname} commands = - rest_cherrypy: pytest --cov=pepper/ --cov-config=tox.ini --cov-report= {posargs} --salt-api-backend=rest_cherrypy - rest_tornado: pytest --cov=pepper/ --cov-config=tox.ini --cov-report= {posargs} --salt-api-backend=rest_tornado + cherrypy: pytest --cov=pepper/ --cov-config=tox.ini --cov-report= {posargs} --salt-api-backend=rest_cherrypy + tornado: pytest --cov=pepper/ --cov-config=tox.ini --cov-report= {posargs} --salt-api-backend=rest_tornado [testenv:flake8] basepython = python3