aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2018-08-01 08:00:51 +0200
committerMichał Górny <mgorny@gentoo.org>2018-08-01 10:38:04 +0200
commitafe5f6320a174578f8aad50ad00ee1e37028334b (patch)
treed739dea093e6ae455700961c7397007479ead7c3 /.travis.yml
parentAdd a tox.ini to support running tests via tox (diff)
downloadportage-afe5f6320a174578f8aad50ad00ee1e37028334b.tar.gz
portage-afe5f6320a174578f8aad50ad00ee1e37028334b.tar.bz2
portage-afe5f6320a174578f8aad50ad00ee1e37028334b.zip
.travis.yml: Take advantage of tox
Replace the code responsible for installing dependencies and running tests on Travis to use tox. This reduces code duplication (= risk of mis-sync) and saves us from those hoops needed to install dependencies conditionally via travis. Reviewed-by: Zac Medico <zmedico@gentoo.org> Closes: https://github.com/gentoo/portage/pull/348
Diffstat (limited to '.travis.yml')
-rw-r--r--.travis.yml28
1 files changed, 6 insertions, 22 deletions
diff --git a/.travis.yml b/.travis.yml
index 9313fc645..846308e08 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,30 +8,14 @@ python:
# command to install dependencies
install:
- - sudo apt-get update -qq
- - sudo apt-get install -y libxml2-utils
- - pip install lxml
- # python3.6+ has sha3 built-in, for older versions install pysha3
- # (except for pypy where pysha3 is broken)
- - "[[ ${TRAVIS_PYTHON_VERSION} == 3.[6789] || ${TRAVIS_PYTHON_VERSION} == pypy ]] || pip install pysha3"
- # python3.6+ has blake2 built-in, for older versions install pyblake2
- - "[[ ${TRAVIS_PYTHON_VERSION} == 3.[6789] ]] || pip install pyblake2"
- # always install pygost for Streebog
- - pip install pygost
- # pyyaml is needed for building
- - pip install pyyaml
+ - pip install tox
script:
- printf "[build_ext]\nportage-ext-modules=true" >> setup.cfg
- ./setup.py test
- ./setup.py install --root=/tmp/install-root
- # prevent repoman tests from trying to fetch metadata.xsd
- - mkdir -p /tmp/install-root/usr/lib/portage/cnf
- - cp repoman/cnf/metadata.xsd /tmp/install-root/usr/lib/portage/cnf/
- - sudo rsync -a /tmp/install-root/. /
- - python -b -Wd -m portage.tests.runTests
- # repoman test block
- - repoman/setup.py test
- - repoman/setup.py install --root=/tmp/install-root
- - sudo rsync -a /tmp/install-root/. /
- - python -b -Wd -m repoman.tests.runTests
+ - if [[ ${TRAVIS_PYTHON_VERSION} == ?.? ]]; then
+ tox -e py${TRAVIS_PYTHON_VERSION/./};
+ else
+ tox -e ${TRAVIS_PYTHON_VERSION};
+ fi