From 8c0d5c314108c09bbb3004d608a5a95bd81b8820 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 3 Nov 2021 10:01:43 -0700 Subject: 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 --- pbr/tests/test_packaging.py | 8 +++++--- 1 file 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): -- cgit v1.2.1