tests: replace check-venv with vm-venv target
With the qemu.qmp and qemu.machine dependencies now installed by default at configure time and additional dependencies required by functional testing installed on demand, we do not need the explicit "check-venv" target. ...However, to facilitate running VM tests without running configure, we move some of the former logic into tests/vm/Makefile.include to create a new venv (vm-venv) on-demand when running VM tests from the source tree. Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20260218213416.674483-17-jsnow@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com>
John Snow committed
Feb 18, 2026 at 16:34 UTC
5abfe61b402eafdd57fa82e3f9638bd4ea4ffb70
2 files changed
+18
-24
tests/Makefile.include
+2
-20
@@ -22,7 +22,6 @@ ifneq ($(filter $(all-check-targets), check-softfloat),)
22
endif
23
@echo
24
@echo " $(MAKE) check-report.junit.xml Generates an aggregated XML test report"
25
- @echo " $(MAKE) check-venv Creates a Python venv for tests"
25
@echo " $(MAKE) check-clean Clean the tests and related data"
26
@echo
27
@echo "The following are useful for CI builds"
@@ -93,33 +92,16 @@ clean-tcg: $(CLEAN_TCG_TARGET_RULES)
92
.PHONY: distclean-tcg
93
distclean-tcg: $(DISTCLEAN_TCG_TARGET_RULES)
94
96
-# Python venv for running tests
97
-
98
-.PHONY: check-venv
99
-
95
# Build up our target list from the filtered list of ninja targets
96
TARGETS=$(patsubst libqemu-%.a, %, $(filter libqemu-%.a, $(ninja-targets)))
97
103
-TESTS_VENV_TOKEN=$(BUILD_DIR)/pyvenv/tests.group
104
-
105
-quiet-venv-pip = $(quiet-@)$(call quiet-command-run, \
106
- $(PYTHON) -m pip -q --disable-pip-version-check $1, \
107
- "VENVPIP","$1")
108
-
109
-$(TESTS_VENV_TOKEN): $(SRC_PATH)/pythondeps.toml
110
- $(call quiet-venv-pip,install -e "$(SRC_PATH)/python/")
111
- $(MKVENV_ENSUREGROUP) $< tooling functests
112
- $(call quiet-command, touch $@)
113
-
114
-check-venv: $(TESTS_VENV_TOKEN)
115
-
98
FUNCTIONAL_TARGETS=$(patsubst %-softmmu,check-functional-%, $(filter %-softmmu,$(TARGETS)))
99
.PHONY: $(FUNCTIONAL_TARGETS)
118
-$(FUNCTIONAL_TARGETS): check-venv
100
+$(FUNCTIONAL_TARGETS):
101
@$(MAKE) SPEED=thorough $(subst -functional,-func,$@)
102
103
.PHONY: check-functional
122
-check-functional: check-venv
104
+check-functional:
105
@$(NINJA) precache-functional
106
@$(PYTHON) $(SRC_PATH)/scripts/clean_functional_cache.py
107
@QEMU_TEST_NO_DOWNLOAD=1 $(MAKE) SPEED=thorough check-func check-func-quick
tests/vm/Makefile.include
+16
-4
@@ -2,13 +2,25 @@
2
3
# Hack to allow running in an unconfigured build tree
4
ifeq ($(realpath $(SRC_PATH)),$(realpath .))
5
-VM_PYTHON = PYTHONPATH=$(SRC_PATH)/python /usr/bin/env python3
6
-VM_VENV =
5
+VM_PYTHON = $(SRC_PATH)/vm-venv/bin/python3
6
+VM_VENV = vm-venv
7
else
8
VM_PYTHON = $(PYTHON)
9
-VM_VENV = check-venv
9
+VM_VENV =
10
endif
11
12
+VM_VENV_TOKEN=$(SRC_PATH)/vm-venv/tooling.group $(SRC_PATH)/vm-venv/functests.group
13
+
14
+$(VM_VENV_TOKEN): $(SRC_PATH)/pythondeps.toml
15
+ /usr/bin/env python3 $(SRC_PATH)/python/scripts/mkvenv.py create vm-venv
16
+ $(SRC_PATH)/vm-venv/bin/python3 \
17
+ $(SRC_PATH)/python/scripts/mkvenv.py ensuregroup --online \
18
+ $(SRC_PATH)/pythondeps.toml tooling functests
19
+
20
+.PHONY: vm-venv
21
+vm-venv: $(VM_VENV_TOKEN)
22
+# end hackery
23
+
24
.PHONY: vm-build-all vm-clean-all
25
26
EFI_AARCH64 = $(wildcard $(BUILD_DIR)/pc-bios/edk2-aarch64-code.fd)
@@ -102,7 +114,7 @@ $(IMAGES_DIR)/%.img: $(SRC_PATH)/tests/vm/% \
114
$(if $(LOG_CONSOLE),--log-console) \
115
--source-path $(SRC_PATH) \
116
--image "$@" \
105
- $(if $(filter-out check-venv, $?), --force) \
117
+ --force \
118
--build-image $@, \
119
" VM-IMAGE $*")
120