From cd7da23937b66fea3ec42fa2f5a128f363a97e7e Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Sun, 21 Dec 2014 16:50:41 +0000 Subject: [PATCH] Integration test PBR commits * pbr/packaging.py(_get_version_from_git): Correct a bug which is causing install failures for PBR-based projects with no Git tags. This slipped through because integration testing was using the most recent PBR release rather than the commit being proposed. * tools/integration.sh: Make sure that if a PBR commit is being tested then we install and use that source rather than the latest PBR release. * tox.ini(testenv:pep8): Get rid of the custom deps list for pep8 and inherit the one from testenv which is already fixed with the self-dependency. Without this, pep8 jobs fail when run with Setuptools 8. Change-Id: Icc7275261e8fc0df8b0ae99184437ca50b89c13a --- pbr/packaging.py | 2 +- tools/integration.sh | 7 +++++++ tox.ini | 2 -- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pbr/packaging.py b/pbr/packaging.py index 6020a811..c84ce738 100644 --- a/pbr/packaging.py +++ b/pbr/packaging.py @@ -490,7 +490,7 @@ def _get_version_from_git(pre_version): # First, if there are no -'s or .'s, then it's just a short sha. # Create a synthetic version for it. if '-' not in raw_version and '.' not in raw_version: - return "0.0.0.post%s" % _get_revno_and_last_tag(git_dir)[0] + return "0.0.0.post%s" % _get_revno_and_last_tag(git_dir) # Now, we want to strip the short-sha prefix stripped_version = raw_version.split('-g')[0] # Finally, if we convert - to .post, which will turn the remaining diff --git a/tools/integration.sh b/tools/integration.sh index 7d6038ae..58ffac87 100644 --- a/tools/integration.sh +++ b/tools/integration.sh @@ -6,6 +6,9 @@ function mkvenv { rm -rf $venv virtualenv $venv $venv/bin/pip install -U pip wheel + if [ $ZUUL_PROJECT = "openstack-dev/pbr" ] ; then + $venv/bin/pip install $pbrsdistdir + fi } # BASE should be a directory with a subdir called "new" and in that @@ -34,6 +37,10 @@ PROJECTS=$* pbrsdistdir=$tmpdir/pbrsdist git clone $REPODIR/pbr $pbrsdistdir cd $pbrsdistdir +if [ $ZUUL_PROJECT = "openstack-dev/pbr" ] ; then + git fetch $ZUUL_URL/$ZUUL_PROJECT $ZUUL_REF + git reset --hard FETCH_HEAD +fi eptest=$tmpdir/eptest mkdir $eptest diff --git a/tox.ini b/tox.ini index 68057b27..3aa3cc78 100644 --- a/tox.ini +++ b/tox.ini @@ -21,8 +21,6 @@ sitepackages = True downloadcache = ~/cache/pip [testenv:pep8] -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt commands = flake8 {posargs} [testenv:cover]