Skip to content
Snippets Groups Projects
Commit a6389ef6 authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

tests: update avocado installation to use mkvenv

The recent changes to Python handling mean that there is a single
virtual environment for all the build, instead of a separate one for testing.
Because this virtual environment will often have system site packages
available, it makes sense to use mkvenv.py to install avocado, which will
avoid using PyPI if a new-enough version is available in the system.

However, requiring a specific version of avocado will cause conflicts with
any avocado plugins installed on the host:

   $ make check-venv
   make[1]: Entering directory '/home/berrange/src/virt/qemu/build'
     GIT     ui/keycodemapdb tests/fp/berkeley-testfloat-3 tests/fp/berkeley-softfloat-3 dtc
     VENVPIP install -e /home/berrange/src/virt/qemu/python/
     VENVPIP install -r /home/berrange/src/virt/qemu/tests/requirements.txt
   ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
   avocado-framework-plugin-varianter-yaml-to-mux 98.0 requires avocado-framework==98.0, but you have avocado-framework 101.0 which is incompatible.
   avocado-framework-plugin-result-html 98.0 requires avocado-framework==98.0, but you have avocado-framework 101.0 which is incompatible.
   make[1]: Leaving directory '/home/berrange/src/virt/qemu/build'

so the requirements should use a ">=" constraint and the versions of
Avocado and pycdlib should be limited to what distros provide
in the system packages.  Only Fedora has Avocado, and more specifically
version 92.0, while the following distros have pycdlib:

   CentOS Stream 8             1.11.0
   CentOS Stream 9             1.11.0
   Fedora 37                   1.13.0
   Fedora 38                   1.14.0
   Ubuntu 22.04                1.11.0
   Debian bookworm             1.12.0

So the current minimal versions specified by tests/requirements.txt are
okay.  Move them to the check-venv target and add the corresponding
constraints to python/tests/minreqs.txt as well.

Resolves: qemu-project/qemu#1663


Reported-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent d06183fd
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,8 @@ distlib==0.3.6
fusepy==2.0.4
# Test-runners, utilities, etc.
avocado-framework==90.0
avocado-framework==88.1
pycdlib==1.11.0
# Linters
flake8==5.0.4
......
# -*- Mode: makefile -*-
AVOCADO_MIN_VERSION=88.1
PYCDLIB_MIN_VERSION=1.11.0
.PHONY: check-help
check-help:
@echo "Regression testing targets:"
......@@ -90,7 +93,7 @@ distclean-tcg: $(DISTCLEAN_TCG_TARGET_RULES)
TARGETS=$(patsubst libqemu-%.fa, %, $(filter libqemu-%.fa, $(ninja-targets)))
TESTS_VENV_TOKEN=$(BUILD_DIR)/pyvenv/tests.group
TESTS_VENV_REQ=$(SRC_PATH)/tests/requirements.txt
TESTS_VENV_REQ=$(SRC_PATH)/python/tests/minreqs.txt
TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results
ifndef AVOCADO_TESTS
AVOCADO_TESTS=tests/avocado
......@@ -112,7 +115,8 @@ quiet-venv-pip = $(quiet-@)$(call quiet-command-run, \
$(TESTS_VENV_TOKEN): $(TESTS_VENV_REQ)
$(call quiet-venv-pip,install -e "$(SRC_PATH)/python/")
$(call quiet-venv-pip,install -r $(TESTS_VENV_REQ))
$(quiet-@)$(PYTHON) $(SRC_PATH)/python/scripts/mkvenv.py ensure --diagnose avocado --online \
'avocado-framework>=$(AVOCADO_MIN_VERSION)' 'pycdlib>=$(PYCDLIB_MIN_VERSION)'
$(call quiet-command, touch $@)
$(TESTS_RESULTS_DIR):
......
# Add Python module requirements, one per line, to be installed
# in the qemu build_dir/pyvenv Python virtual environment. For more info,
# refer to: https://pip.pypa.io/en/stable/user_guide/#id1
#
# Note that qemu.git/python/ is implicitly installed to this venv when
# 'make check-venv' is run, and will persist until configure is run
# again.
avocado-framework==88.1
pycdlib==1.11.0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment