summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClark Boylan <clark.boylan@gmail.com>2021-11-03 10:01:43 -0700
committerClark Boylan <clark.boylan@gmail.com>2021-11-03 10:01:43 -0700
commit8c0d5c314108c09bbb3004d608a5a95bd81b8820 (patch)
tree1d0ae241ac9d7a7416b6a029930f1dc8aa03661c
parent11a1438036ac08097d90422d126f067b1d3ca706 (diff)
downloadpbr-8c0d5c314108c09bbb3004d608a5a95bd81b8820.tar.gz
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
-rw-r--r--pbr/tests/test_packaging.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pbr/tests/test_packaging.py b/pbr/tests/test_packaging.py
index 9e95a86..5d64b98 100644
--- a/pbr/tests/test_packaging.py
+++ b/pbr/tests/test_packaging.py
@@ -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):