From dff56ffd5a731f53cf08ac01a46304cfffb09912 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Tue, 20 Feb 2018 05:45:19 -0800 Subject: [PATCH 1/2] add release testing to TravisCI --- .travis.yml | 7 ++++++- Makefile | 2 +- release-test.sh | 32 ++++++++++++++++++-------------- 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 955e71fe8..5be45a5df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ sudo: false language: python +cache: pip python: - 2.7 - 3.3 @@ -10,9 +11,13 @@ os: - linux install: - pip install tox-travis +jobs: + include: + - stage: release-test + script: RELEASE_SKIP=head ./release-test.sh script: tox branches: only: - master notifications: - email: false \ No newline at end of file + email: false diff --git a/Makefile b/Makefile index 9a3939a91..186c1d4ef 100644 --- a/Makefile +++ b/Makefile @@ -56,7 +56,7 @@ install: FORCE dist: dist/${MODULE}-$(VERSION).tar.gz dist/${MODULE}-$(VERSION).tar.gz: $(SOURCES) - ./setup.py sdist + ./setup.py sdist bdist-wheel ## clean : clean up all temporary / machine-generated files clean: FORCE diff --git a/release-test.sh b/release-test.sh index 44074e757..f96729d6e 100755 --- a/release-test.sh +++ b/release-test.sh @@ -12,24 +12,28 @@ pipver=7.0.2 # minimum required version of pip rm -Rf testenv? || /bin/true export HEAD=`git rev-parse HEAD` -virtualenv testenv1 + +if [ "${RELEASE_SKIP}" != "head" ] +then + virtualenv testenv1 + # First we test the head + source testenv1/bin/activate + rm testenv1/lib/python-wheels/setuptools* \ + && pip install --force-reinstall -U pip==${pipver} \ + && pip install setuptools==20.10.1 wheel + make install-dep + make test + pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install + mkdir testenv1/not-${module} + # if there is a subdir named '${module}' py.test will execute tests + # there instead of the installed module's tests + pushd testenv1/not-${module}; ../bin/${run_tests}; popd +fi + virtualenv testenv2 virtualenv testenv3 virtualenv testenv4 -# First we test the head -source testenv1/bin/activate -rm testenv1/lib/python-wheels/setuptools* \ - && pip install --force-reinstall -U pip==${pipver} \ - && pip install setuptools==20.10.1 wheel -make install-dep -make test -pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install -mkdir testenv1/not-${module} -# if there is a subdir named '${module}' py.test will execute tests -# there instead of the installed module's tests -pushd testenv1/not-${module}; ../bin/${run_tests}; popd - # Secondly we test via pip From 9f73fcad0287a482fbf050c038b024f7779e7050 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Tue, 20 Feb 2018 05:56:42 -0800 Subject: [PATCH 2/2] use TRAVIS_PULL_REQUEST_SHA if present --- Makefile | 2 +- release-test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 186c1d4ef..a184229d6 100644 --- a/Makefile +++ b/Makefile @@ -56,7 +56,7 @@ install: FORCE dist: dist/${MODULE}-$(VERSION).tar.gz dist/${MODULE}-$(VERSION).tar.gz: $(SOURCES) - ./setup.py sdist bdist-wheel + ./setup.py sdist bdist_wheel ## clean : clean up all temporary / machine-generated files clean: FORCE diff --git a/release-test.sh b/release-test.sh index f96729d6e..cdc22dad0 100755 --- a/release-test.sh +++ b/release-test.sh @@ -11,7 +11,7 @@ pipver=7.0.2 # minimum required version of pip rm -Rf testenv? || /bin/true -export HEAD=`git rev-parse HEAD` +export HEAD=${TRAVIS_PULL_REQUEST_SHA:-$(git rev-parse HEAD)} if [ "${RELEASE_SKIP}" != "head" ] then