PBR package testing improvements

We simplify virtualenv setup for PBR package installation testing by
switching to a simple file path for the PBR installation rather than a
full url with egg specifier. The egg specifer isn't necessary and
neither is the url and simpler is easier to understand.

We also add the verbose flag to the pip installations of tools into that
virtualenv to better understand problems when they occur.

Finally we add the option to skip writing package files if their
contents are empty. This allows us to ensure that we can omit certain
files which will be useful for the next change.

Change-Id: I1f081d29d62c905c1bb1abee5402b0990c83e948
This commit is contained in:
Clark Boylan 2021-11-03 10:01:43 -07:00
parent 11a1438036
commit 8c0d5c3141
1 changed files with 5 additions and 3 deletions

View File

@ -172,11 +172,10 @@ class Venv(fixtures.Fixture):
"""
self._reason = reason
if modules == ():
pbr = 'file://%s#egg=pbr' % PBR_ROOT
modules = ['pip', 'wheel', pbr]
modules = ['pip', 'wheel', PBR_ROOT]
self.modules = modules
if pip_cmd is None:
self.pip_cmd = ['-m', 'pip', 'install']
self.pip_cmd = ['-m', 'pip', '-v', 'install']
else:
self.pip_cmd = pip_cmd
@ -230,6 +229,9 @@ class CreatePackages(fixtures.Fixture):
self.packages = packages
def _writeFile(self, directory, file_name, contents):
if not contents:
# We want to be able to override not having files
return
path = os.path.abspath(os.path.join(directory, file_name))
path_dir = os.path.dirname(path)
if not os.path.exists(path_dir):