From: John Snow <jsnow@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Warner Losh" <imp@bsdimp.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Ani Sinha" <anisinha@redhat.com>,
"Beraldo Leal" <bleal@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Ryo ONODERA" <ryoon@netbsd.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Kyle Evans" <kevans@freebsd.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Michael Roth" <michael.roth@amd.com>,
"Reinoud Zandijk" <reinoud@netbsd.org>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Cleber Rosa" <crosa@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"John Snow" <jsnow@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Wainer dos Santos Moschetta" <wainersm@redhat.com>
Subject: [PATCH 19/27] tests: Use configure-provided pyvenv for tests
Date: Wed, 10 May 2023 23:54:27 -0400 [thread overview]
Message-ID: <20230511035435.734312-20-jsnow@redhat.com> (raw)
In-Reply-To: <20230511035435.734312-1-jsnow@redhat.com>
This patch changes how the avocado tests are provided, ever so
slightly. Instead of creating a new testing venv, use the
configure-provided 'pyvenv' instead, and install optional packages into
that.
Signed-off-by: John Snow <jsnow@redhat.com>
---
docs/devel/acpi-bits.rst | 6 +++---
docs/devel/testing.rst | 14 +++++++-------
.gitlab-ci.d/buildtest.yml | 6 +++---
scripts/ci/org.centos/stream/8/x86_64/test-avocado | 4 ++--
scripts/device-crash-test | 2 +-
tests/Makefile.include | 10 +++++-----
tests/requirements.txt | 7 +++++--
7 files changed, 26 insertions(+), 23 deletions(-)
diff --git a/docs/devel/acpi-bits.rst b/docs/devel/acpi-bits.rst
index 22e2580200..9677b0098f 100644
--- a/docs/devel/acpi-bits.rst
+++ b/docs/devel/acpi-bits.rst
@@ -61,19 +61,19 @@ Under ``tests/avocado/`` as the root we have:
::
$ make check-venv (needed only the first time to create the venv)
- $ ./tests/venv/bin/avocado run -t acpi tests/avocado
+ $ ./pyvenv/bin/avocado run -t acpi tests/avocado
The above will run all acpi avocado tests including this one.
In order to run the individual tests, perform the following:
::
- $ ./tests/venv/bin/avocado run tests/avocado/acpi-bits.py --tap -
+ $ ./pyvenv/bin/avocado run tests/avocado/acpi-bits.py --tap -
The above will produce output in tap format. You can omit "--tap -" in the
end and it will produce output like the following:
::
- $ ./tests/venv/bin/avocado run tests/avocado/acpi-bits.py
+ $ ./pyvenv/bin/avocado run tests/avocado/acpi-bits.py
Fetching asset from tests/avocado/acpi-bits.py:AcpiBitsTest.test_acpi_smbios_bits
JOB ID : eab225724da7b64c012c65705dc2fa14ab1defef
JOB LOG : /home/anisinha/avocado/job-results/job-2022-10-10T17.58-eab2257/job.log
diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
index 4071e72710..50664d9eb9 100644
--- a/docs/devel/testing.rst
+++ b/docs/devel/testing.rst
@@ -882,9 +882,9 @@ You can run the avocado tests simply by executing:
make check-avocado
-This involves the automatic creation of Python virtual environment
-within the build tree (at ``tests/venv``) which will have all the
-right dependencies, and will save tests results also within the
+This involves the automatic installation, from PyPI, of all the
+necessary avocado-framework dependencies into the QEMU venv within the
+build tree (at ``./pyvenv``). Test results are also saved within the
build tree (at ``tests/results``).
Note: the build environment must be using a Python 3 stack, and have
@@ -941,7 +941,7 @@ may be invoked by running:
.. code::
- tests/venv/bin/avocado run $OPTION1 $OPTION2 tests/avocado/
+ pyvenv/bin/avocado run $OPTION1 $OPTION2 tests/avocado/
Note that if ``make check-avocado`` was not executed before, it is
possible to create the Python virtual environment with the dependencies
@@ -956,20 +956,20 @@ a test file. To run tests from a single file within the build tree, use:
.. code::
- tests/venv/bin/avocado run tests/avocado/$TESTFILE
+ pyvenv/bin/avocado run tests/avocado/$TESTFILE
To run a single test within a test file, use:
.. code::
- tests/venv/bin/avocado run tests/avocado/$TESTFILE:$TESTCLASS.$TESTNAME
+ pyvenv/bin/avocado run tests/avocado/$TESTFILE:$TESTCLASS.$TESTNAME
Valid test names are visible in the output from any previous execution
of Avocado or ``make check-avocado``, and can also be queried using:
.. code::
- tests/venv/bin/avocado list tests/avocado
+ pyvenv/bin/avocado list tests/avocado
Manual Installation
~~~~~~~~~~~~~~~~~~~
diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
index bb3650a51c..307cba1aab 100644
--- a/.gitlab-ci.d/buildtest.yml
+++ b/.gitlab-ci.d/buildtest.yml
@@ -103,7 +103,7 @@ crash-test-debian:
script:
- cd build
- make NINJA=":" check-venv
- - tests/venv/bin/python3 scripts/device-crash-test -q --tcg-only ./qemu-system-i386
+ - pyvenv/bin/python3 scripts/device-crash-test -q --tcg-only ./qemu-system-i386
build-system-fedora:
extends:
@@ -146,8 +146,8 @@ crash-test-fedora:
script:
- cd build
- make NINJA=":" check-venv
- - tests/venv/bin/python3 scripts/device-crash-test -q ./qemu-system-ppc
- - tests/venv/bin/python3 scripts/device-crash-test -q ./qemu-system-riscv32
+ - pyvenv/bin/python3 scripts/device-crash-test -q ./qemu-system-ppc
+ - pyvenv/bin/python3 scripts/device-crash-test -q ./qemu-system-riscv32
build-system-centos:
extends:
diff --git a/scripts/ci/org.centos/stream/8/x86_64/test-avocado b/scripts/ci/org.centos/stream/8/x86_64/test-avocado
index d2c0e5fb4c..7bb5b317b6 100755
--- a/scripts/ci/org.centos/stream/8/x86_64/test-avocado
+++ b/scripts/ci/org.centos/stream/8/x86_64/test-avocado
@@ -4,7 +4,7 @@
# KVM and x86_64, or tests that are generic enough to be valid for all
# targets. Such a test list can be generated with:
#
-# ./tests/venv/bin/avocado list --filter-by-tags-include-empty \
+# ./pyvenv/bin/avocado list --filter-by-tags-include-empty \
# --filter-by-tags-include-empty-key -t accel:kvm,arch:x86_64 \
# tests/avocado/
#
@@ -22,7 +22,7 @@
# - tests/avocado/virtio_check_params.py:VirtioMaxSegSettingsCheck.test_machine_types
#
make get-vm-images
-./tests/venv/bin/avocado run \
+./pyvenv/bin/avocado run \
--job-results-dir=tests/results/ \
tests/avocado/boot_linux.py:BootLinuxX8664.test_pc_i440fx_kvm \
tests/avocado/boot_linux.py:BootLinuxX8664.test_pc_q35_kvm \
diff --git a/scripts/device-crash-test b/scripts/device-crash-test
index b74d887331..353aa575d7 100755
--- a/scripts/device-crash-test
+++ b/scripts/device-crash-test
@@ -43,7 +43,7 @@ except ModuleNotFoundError as exc:
print(f"Module '{exc.name}' not found.")
print(" Try 'make check-venv' from your build directory,")
print(" and then one way to run this script is like so:")
- print(f' > $builddir/tests/venv/bin/python3 "{path}"')
+ print(f' > $builddir/pyvenv/bin/python3 "{path}"')
sys.exit(1)
logger = logging.getLogger('device-crash-test')
diff --git a/tests/Makefile.include b/tests/Makefile.include
index a4de0ad5a2..5b838ec438 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -89,7 +89,8 @@ distclean-tcg: $(DISTCLEAN_TCG_TARGET_RULES)
# Build up our target list from the filtered list of ninja targets
TARGETS=$(patsubst libqemu-%.fa, %, $(filter libqemu-%.fa, $(ninja-targets)))
-TESTS_VENV_DIR=$(BUILD_DIR)/tests/venv
+TESTS_VENV_DIR=$(BUILD_DIR)/pyvenv
+TESTS_VENV_TOKEN=$(BUILD_DIR)/pyvenv/tests.group
TESTS_VENV_REQ=$(SRC_PATH)/tests/requirements.txt
TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results
TESTS_PYTHON=$(TESTS_VENV_DIR)/bin/python3
@@ -111,8 +112,7 @@ quiet-venv-pip = $(quiet-@)$(call quiet-command-run, \
$(TESTS_PYTHON) -m pip -q --disable-pip-version-check $1, \
"VENVPIP","$1")
-$(TESTS_VENV_DIR): $(TESTS_VENV_REQ)
- $(call quiet-command, $(PYTHON) -m venv $@, VENV, $@)
+$(TESTS_VENV_TOKEN): $(TESTS_VENV_REQ)
$(call quiet-venv-pip,install -e "$(SRC_PATH)/python/")
$(call quiet-venv-pip,install -r $(TESTS_VENV_REQ))
$(call quiet-command, touch $@)
@@ -121,7 +121,7 @@ $(TESTS_RESULTS_DIR):
$(call quiet-command, mkdir -p $@, \
MKDIR, $@)
-check-venv: $(TESTS_VENV_DIR)
+check-venv: $(TESTS_VENV_TOKEN)
FEDORA_31_ARCHES_TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGETS)))
FEDORA_31_ARCHES_CANDIDATES=$(patsubst ppc64,ppc64le,$(FEDORA_31_ARCHES_TARGETS))
@@ -167,7 +167,7 @@ check:
check-build: run-ninja
check-clean:
- rm -rf $(TESTS_VENV_DIR) $(TESTS_RESULTS_DIR)
+ rm -rf $(TESTS_RESULTS_DIR)
clean: check-clean clean-tcg
distclean: distclean-tcg
diff --git a/tests/requirements.txt b/tests/requirements.txt
index a6f73da681..0e008b9aec 100644
--- a/tests/requirements.txt
+++ b/tests/requirements.txt
@@ -1,6 +1,9 @@
# Add Python module requirements, one per line, to be installed
-# in the tests/venv Python virtual environment. For more info,
+# 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 always implicitly installed.
+#
+# 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==101.0
pycdlib==1.11.0
--
2.40.0
next prev parent reply other threads:[~2023-05-11 3:57 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-11 3:54 [PATCH 00/27] configure: create a python venv and ensure meson, sphinx John Snow
2023-05-11 3:54 ` [PATCH 01/27] python: shut up "pip install" during "make check-minreqs" John Snow
2023-05-11 3:54 ` [PATCH 02/27] python: update pylint configuration John Snow
2023-05-11 3:54 ` [PATCH 03/27] python: add mkvenv.py John Snow
2023-05-11 3:54 ` [PATCH 04/27] mkvenv: add better error message for missing pyexpat module John Snow
2023-05-11 3:54 ` [PATCH 05/27] mkvenv: add nested venv workaround John Snow
2023-05-11 3:54 ` [PATCH 06/27] mkvenv: add ensure subcommand John Snow
2023-05-11 3:54 ` [PATCH 07/27] mkvenv: add diagnose() method for ensure() failures John Snow
2023-05-11 6:53 ` Paolo Bonzini
2023-05-11 15:53 ` John Snow
2023-05-11 15:56 ` Paolo Bonzini
2023-05-11 15:59 ` John Snow
2023-05-11 3:54 ` [PATCH 08/27] mkvenv: add console script entry point generation John Snow
2023-05-11 3:54 ` [PATCH 09/27] mkvenv: create pip binary in virtual environment John Snow
2023-05-11 3:54 ` [PATCH 10/27] mkvenv: work around broken pip installations on Debian 10 John Snow
2023-05-11 3:54 ` [PATCH 11/27] tests/docker: add python3-venv dependency John Snow
2023-05-11 3:54 ` [PATCH 12/27] tests/vm: Configure netbsd to use Python 3.10 John Snow
2023-05-11 3:54 ` [PATCH 13/27] tests/vm: add py310-expat to NetBSD John Snow
2023-05-11 3:54 ` [PATCH 14/27] python: add vendor.py utility John Snow
2023-05-11 3:54 ` [PATCH 15/27] configure: create a python venv unconditionally John Snow
2023-05-11 3:54 ` [PATCH 16/27] python/wheels: add vendored meson package John Snow
2023-05-11 3:54 ` [PATCH 17/27] configure: use 'mkvenv ensure meson' to bootstrap meson John Snow
2023-05-11 3:54 ` [PATCH 18/27] qemu.git: drop meson git submodule John Snow
2023-05-11 3:54 ` John Snow [this message]
2023-05-11 3:54 ` [PATCH 20/27] configure: move --enable-docs and --disable-docs back to configure John Snow
2023-05-11 3:54 ` [PATCH 21/27] configure: bootstrap sphinx with mkvenv John Snow
2023-05-11 3:54 ` [PATCH 22/27] configure: add --enable-pypi and --disable-pypi John Snow
2023-05-11 3:54 ` [PATCH 23/27] Python: Drop support for Python 3.6 John Snow
2023-05-11 3:54 ` [PATCH 24/27] configure: Add courtesy hint to Python version failure message John Snow
2023-05-11 3:54 ` [PATCH 25/27] mkvenv: mark command as required John Snow
2023-05-11 3:54 ` [PATCH 26/27] python: bump some of the dependencies John Snow
2023-05-11 3:54 ` [PATCH 27/27] mkvenv.py: experiment; use distlib to generate script entry points John Snow
2023-05-11 6:57 ` Paolo Bonzini
2023-05-11 7:02 ` Paolo Bonzini
2023-05-11 15:58 ` John Snow
2023-05-11 16:14 ` Paolo Bonzini
2023-05-11 16:16 ` John Snow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230511035435.734312-20-jsnow@redhat.com \
--to=jsnow@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=anisinha@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=bleal@redhat.com \
--cc=crosa@redhat.com \
--cc=imp@bsdimp.com \
--cc=kevans@freebsd.org \
--cc=marcandre.lureau@redhat.com \
--cc=michael.roth@amd.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=reinoud@netbsd.org \
--cc=ryoon@netbsd.org \
--cc=thuth@redhat.com \
--cc=wainersm@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).