From cc86e32e1538d3638dce9afee5b8d6ec0c4dcb6c Mon Sep 17 00:00:00 2001 From: Ondrej Nosek Date: Nov 26 2019 07:23:56 +0000 Subject: Resolve Jenkins unittests failing Disabling Jenkins unittests for Python2.6, because it is not supported by the Jenkins system anymore. To continue running unittests I also had to change the approach to install dependent libraries - not to use sitepackages. Libraries that are needed are installed by pip directly. It leads to skipping of some tests that require bodhi-client. JIRA: COMPOSE-3826 Signed-off-by: Ondrej Nosek --- diff --git a/tests-requirements.txt b/tests-requirements.txt index 1cc4eb4..fd24ddd 100644 --- a/tests-requirements.txt +++ b/tests-requirements.txt @@ -1,5 +1,6 @@ mock == 1.0.1 nose == 1.3.7 nose-cov +cccolutils +gitpython freezegun -PyYAML diff --git a/tox.ini b/tox.ini index 903429b..efbfcc0 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,14 @@ envlist = py26,py27,py36,py37,flake8 [testenv] -sitepackages=True +sitepackages=False +basepython= + py26: {env:TOXPYTHON:python2.6} + py27: {env:TOXPYTHON:python2.7} + py36: {env:TOXPYTHON:python3.6} + py37: {env:TOXPYTHON:python3.7} + flake8: {env:TOXPYTHON:python3.7} + flake8python2: {env:TOXPYTHON:python2.7} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/tests-requirements.txt @@ -10,18 +17,18 @@ passenv=PYTHONPATH commands = # Pip call is workaround. Nose is not installed in virtual environment when # nose is already installed in system. -I parameter is vital for install. - pip install -I nose==1.3.7 - nosetests {posargs} + pip install -I nose==1.3.7 + pip install -I gitpython + # pip install -I pycurl + # /usr/bin/which nosetests-3 + python -m nose --exe --with-cov --cov-report html --cov-config setup.cfg --cov fedpkg test/ {posargs} setenv= PYCURL_SSL_LIBRARY=openssl -[testenv:py26] -commands = - pip install -I "setuptools<37.0.0" "wheel<0.30.0" unittest2 - {[testenv]commands} - [testenv:flake8] sitepackages = False -skip_install = True -deps = flake8 == 3.5.0 -commands = flake8 fedpkg/ test/ +deps = flake8 +commands = python -m flake8 fedpkg/ test/ + +[testenv:flake8python2] +{[testenv:flake8]}