[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v3 7/7] iotests: self-bootstrap testing venv
From: |
John Snow |
Subject: |
[RFC PATCH v3 7/7] iotests: self-bootstrap testing venv |
Date: |
Mon, 11 Jul 2022 19:01:55 -0400 |
When iotests are invoked manually from
e.g. $build/tests/qemu-iotests/check, it is not necessarily guaranteed
that we'll have run 'check-venv' yet.
With this patch, teach testenv.py how to create its own environment.
Note: this self-bootstrapping is fairly rudimentary and will miss
certain triggers to refresh the venv. It will miss when new dependencies
are added to either python/setup.cfg or tests/setup.cfg. It can be
coaxed into updating by running 'make check', 'make check-block', 'make
check-venv', etc.
Signed-off-by: John Snow <jsnow@redhat.com>
---
tests/qemu-iotests/testenv.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py
index 29404ac94be..e985eaf3e97 100644
--- a/tests/qemu-iotests/testenv.py
+++ b/tests/qemu-iotests/testenv.py
@@ -112,10 +112,10 @@ def init_directories(self) -> None:
"""
venv_path = Path(self.build_root, 'tests/venv/')
if not venv_path.exists():
- raise FileNotFoundError(
- f"Virtual environment \"{venv_path!s}\" isn't found."
- " (Maybe you need to run 'make check-venv'"
- " from the build dir?)"
+ mkvenv = Path(self.source_iotests, '../mkvenv.py')
+ subprocess.run(
+ (sys.executable, str(mkvenv), str(venv_path)),
+ check=True,
)
self.virtual_env: str = str(venv_path)
--
2.34.3
- [RFC PATCH v3 0/7] tests: run python tests under a venv, John Snow, 2022/07/11
- [RFC PATCH v3 2/7] tests: pythonize test venv creation, John Snow, 2022/07/11
- [RFC PATCH v3 7/7] iotests: self-bootstrap testing venv,
John Snow <=
- [RFC PATCH v3 6/7] iotests: use tests/venv for running tests, John Snow, 2022/07/11
- [RFC PATCH v3 4/7] tests/vm: add venv pre-requisites to VM building recipes, John Snow, 2022/07/11
- [RFC PATCH v3 1/7] tests: create optional tests/venv dependency groups, John Snow, 2022/07/11
- [RFC PATCH v3 5/7] tests: add 'check-venv' as a dependency of 'make check', John Snow, 2022/07/11
- [RFC PATCH v3 3/7] tests: Remove spurious pip warnings on Ubuntu20.04, John Snow, 2022/07/11