Add check-venv target as a dependency for the functional tests. This
causes Python modules listed in pythondeps.toml, under the testdeps
group, to be installed when 'make check-functional' is executed to
prepare and run the functional tests.
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Suggested-by: Thomas Huth <thuth@redhat.com>
---
tests/Makefile.include | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 3538c0c740..d012a9b25d 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -109,7 +109,7 @@ $(FUNCTIONAL_TARGETS):
@$(MAKE) SPEED=thorough $(subst -functional,-func,$@)
.PHONY: check-functional
-check-functional:
+check-functional: check-venv
@$(NINJA) precache-functional
@QEMU_TEST_NO_DOWNLOAD=1 $(MAKE) SPEED=thorough check-func check-func-quick
--
2.34.1
On 26/09/2025 07.15, Gustavo Romero wrote: > Add check-venv target as a dependency for the functional tests. This > causes Python modules listed in pythondeps.toml, under the testdeps > group, to be installed when 'make check-functional' is executed to > prepare and run the functional tests. > > Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> > Suggested-by: Thomas Huth <thuth@redhat.com> > --- > tests/Makefile.include | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/Makefile.include b/tests/Makefile.include > index 3538c0c740..d012a9b25d 100644 > --- a/tests/Makefile.include > +++ b/tests/Makefile.include > @@ -109,7 +109,7 @@ $(FUNCTIONAL_TARGETS): > @$(MAKE) SPEED=thorough $(subst -functional,-func,$@) > > .PHONY: check-functional > -check-functional: > +check-functional: check-venv I just noticed that there's still a problem: If you run "make check-functional-aarch64" immediately after configuring + compiling QEMU in a fresh folder for the first time, the functional tests fail with: ModuleNotFoundError: No module named 'pygdbmi' We either need to add dependencies to the check-functional-<arch> targets, too, or we have to make sure that tests still get properly skipped in the case that pygdbmi has not been installed into the venv yet. Thomas
Hi Thomas! On 9/26/25 05:34, Thomas Huth wrote: > On 26/09/2025 07.15, Gustavo Romero wrote: >> Add check-venv target as a dependency for the functional tests. This >> causes Python modules listed in pythondeps.toml, under the testdeps >> group, to be installed when 'make check-functional' is executed to >> prepare and run the functional tests. >> >> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> >> Suggested-by: Thomas Huth <thuth@redhat.com> >> --- >> tests/Makefile.include | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/tests/Makefile.include b/tests/Makefile.include >> index 3538c0c740..d012a9b25d 100644 >> --- a/tests/Makefile.include >> +++ b/tests/Makefile.include >> @@ -109,7 +109,7 @@ $(FUNCTIONAL_TARGETS): >> @$(MAKE) SPEED=thorough $(subst -functional,-func,$@) >> .PHONY: check-functional >> -check-functional: >> +check-functional: check-venv > > I just noticed that there's still a problem: If you run "make check-functional-aarch64" immediately after configuring + compiling QEMU in a fresh folder for the first time, the functional tests fail with: > > ModuleNotFoundError: No module named 'pygdbmi' > > We either need to add dependencies to the check-functional-<arch> targets, too, or we have to make sure that tests still get properly skipped in the case that pygdbmi has not been installed into the venv yet. Isn't it inconsistent that check-functional runs the test and check-functional-<arch> doesn't? I think it's a good idea to skip if the module is not available, yeah, I'll add it in v6, but would it be ok to add check-venv to the check-functional-<arch> targets too? That solution feels a tad cumbersome to me to make them consistent but really I don't have any better idea... Cheers, Gustavo
On Fri, Sep 26, 2025 at 10:34:01AM +0200, Thomas Huth wrote: > On 26/09/2025 07.15, Gustavo Romero wrote: > > Add check-venv target as a dependency for the functional tests. This > > causes Python modules listed in pythondeps.toml, under the testdeps > > group, to be installed when 'make check-functional' is executed to > > prepare and run the functional tests. > > > > Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> > > Suggested-by: Thomas Huth <thuth@redhat.com> > > --- > > tests/Makefile.include | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tests/Makefile.include b/tests/Makefile.include > > index 3538c0c740..d012a9b25d 100644 > > --- a/tests/Makefile.include > > +++ b/tests/Makefile.include > > @@ -109,7 +109,7 @@ $(FUNCTIONAL_TARGETS): > > @$(MAKE) SPEED=thorough $(subst -functional,-func,$@) > > .PHONY: check-functional > > -check-functional: > > +check-functional: check-venv > > I just noticed that there's still a problem: If you run "make > check-functional-aarch64" immediately after configuring + compiling QEMU in > a fresh folder for the first time, the functional tests fail with: > > ModuleNotFoundError: No module named 'pygdbmi' > > We either need to add dependencies to the check-functional-<arch> targets, > too, or we have to make sure that tests still get properly skipped in the > case that pygdbmi has not been installed into the venv yet. We already have a decorator for skipping tests when modules are missing, so we should add usage of that. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
On 26/09/2025 10.37, Daniel P. Berrangé wrote: > On Fri, Sep 26, 2025 at 10:34:01AM +0200, Thomas Huth wrote: >> On 26/09/2025 07.15, Gustavo Romero wrote: >>> Add check-venv target as a dependency for the functional tests. This >>> causes Python modules listed in pythondeps.toml, under the testdeps >>> group, to be installed when 'make check-functional' is executed to >>> prepare and run the functional tests. >>> >>> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> >>> Suggested-by: Thomas Huth <thuth@redhat.com> >>> --- >>> tests/Makefile.include | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/tests/Makefile.include b/tests/Makefile.include >>> index 3538c0c740..d012a9b25d 100644 >>> --- a/tests/Makefile.include >>> +++ b/tests/Makefile.include >>> @@ -109,7 +109,7 @@ $(FUNCTIONAL_TARGETS): >>> @$(MAKE) SPEED=thorough $(subst -functional,-func,$@) >>> .PHONY: check-functional >>> -check-functional: >>> +check-functional: check-venv >> >> I just noticed that there's still a problem: If you run "make >> check-functional-aarch64" immediately after configuring + compiling QEMU in >> a fresh folder for the first time, the functional tests fail with: >> >> ModuleNotFoundError: No module named 'pygdbmi' >> >> We either need to add dependencies to the check-functional-<arch> targets, >> too, or we have to make sure that tests still get properly skipped in the >> case that pygdbmi has not been installed into the venv yet. > > We already have a decorator for skipping tests when modules are missing, > so we should add usage of that. Ack ... and the "from .gdb import GDB" in qemu_test/__init__.py likely also has to go away, to avoid that each and every test tries to pull in the gdb code. Thomas
On Fri, Sep 26, 2025 at 10:42:22AM +0200, Thomas Huth wrote: > On 26/09/2025 10.37, Daniel P. Berrangé wrote: > > On Fri, Sep 26, 2025 at 10:34:01AM +0200, Thomas Huth wrote: > > > On 26/09/2025 07.15, Gustavo Romero wrote: > > > > Add check-venv target as a dependency for the functional tests. This > > > > causes Python modules listed in pythondeps.toml, under the testdeps > > > > group, to be installed when 'make check-functional' is executed to > > > > prepare and run the functional tests. > > > > > > > > Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> > > > > Suggested-by: Thomas Huth <thuth@redhat.com> > > > > --- > > > > tests/Makefile.include | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > diff --git a/tests/Makefile.include b/tests/Makefile.include > > > > index 3538c0c740..d012a9b25d 100644 > > > > --- a/tests/Makefile.include > > > > +++ b/tests/Makefile.include > > > > @@ -109,7 +109,7 @@ $(FUNCTIONAL_TARGETS): > > > > @$(MAKE) SPEED=thorough $(subst -functional,-func,$@) > > > > .PHONY: check-functional > > > > -check-functional: > > > > +check-functional: check-venv > > > > > > I just noticed that there's still a problem: If you run "make > > > check-functional-aarch64" immediately after configuring + compiling QEMU in > > > a fresh folder for the first time, the functional tests fail with: > > > > > > ModuleNotFoundError: No module named 'pygdbmi' > > > > > > We either need to add dependencies to the check-functional-<arch> targets, > > > too, or we have to make sure that tests still get properly skipped in the > > > case that pygdbmi has not been installed into the venv yet. > > > > We already have a decorator for skipping tests when modules are missing, > > so we should add usage of that. > > Ack ... and the "from .gdb import GDB" in qemu_test/__init__.py likely also > has to go away, to avoid that each and every test tries to pull in the gdb > code. Or alternatively the gdb module can move the gdbmi import so that it is only referenced in method scope, so it becomes relevant only when executed. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Hi Daniel, On 9/26/25 05:50, Daniel P. Berrangé wrote: > On Fri, Sep 26, 2025 at 10:42:22AM +0200, Thomas Huth wrote: >> On 26/09/2025 10.37, Daniel P. Berrangé wrote: >>> On Fri, Sep 26, 2025 at 10:34:01AM +0200, Thomas Huth wrote: >>>> On 26/09/2025 07.15, Gustavo Romero wrote: >>>>> Add check-venv target as a dependency for the functional tests. This >>>>> causes Python modules listed in pythondeps.toml, under the testdeps >>>>> group, to be installed when 'make check-functional' is executed to >>>>> prepare and run the functional tests. >>>>> >>>>> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> >>>>> Suggested-by: Thomas Huth <thuth@redhat.com> >>>>> --- >>>>> tests/Makefile.include | 2 +- >>>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>>> >>>>> diff --git a/tests/Makefile.include b/tests/Makefile.include >>>>> index 3538c0c740..d012a9b25d 100644 >>>>> --- a/tests/Makefile.include >>>>> +++ b/tests/Makefile.include >>>>> @@ -109,7 +109,7 @@ $(FUNCTIONAL_TARGETS): >>>>> @$(MAKE) SPEED=thorough $(subst -functional,-func,$@) >>>>> .PHONY: check-functional >>>>> -check-functional: >>>>> +check-functional: check-venv >>>> >>>> I just noticed that there's still a problem: If you run "make >>>> check-functional-aarch64" immediately after configuring + compiling QEMU in >>>> a fresh folder for the first time, the functional tests fail with: >>>> >>>> ModuleNotFoundError: No module named 'pygdbmi' >>>> >>>> We either need to add dependencies to the check-functional-<arch> targets, >>>> too, or we have to make sure that tests still get properly skipped in the >>>> case that pygdbmi has not been installed into the venv yet. >>> >>> We already have a decorator for skipping tests when modules are missing, >>> so we should add usage of that. >> >> Ack ... and the "from .gdb import GDB" in qemu_test/__init__.py likely also >> has to go away, to avoid that each and every test tries to pull in the gdb >> code. > > Or alternatively the gdb module can move the gdbmi import so that it is > only referenced in method scope, so it becomes relevant only when > executed. I can´t follow what you meant here. Do mind expanding on it a bit? Cheers, Gustavo
On Fri, Sep 26, 2025 at 12:44:58PM -0300, Gustavo Romero wrote: > Hi Daniel, > > On 9/26/25 05:50, Daniel P. Berrangé wrote: > > On Fri, Sep 26, 2025 at 10:42:22AM +0200, Thomas Huth wrote: > > > On 26/09/2025 10.37, Daniel P. Berrangé wrote: > > > > On Fri, Sep 26, 2025 at 10:34:01AM +0200, Thomas Huth wrote: > > > > > On 26/09/2025 07.15, Gustavo Romero wrote: > > > > > > Add check-venv target as a dependency for the functional tests. This > > > > > > causes Python modules listed in pythondeps.toml, under the testdeps > > > > > > group, to be installed when 'make check-functional' is executed to > > > > > > prepare and run the functional tests. > > > > > > > > > > > > Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> > > > > > > Suggested-by: Thomas Huth <thuth@redhat.com> > > > > > > --- > > > > > > tests/Makefile.include | 2 +- > > > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > > > > > diff --git a/tests/Makefile.include b/tests/Makefile.include > > > > > > index 3538c0c740..d012a9b25d 100644 > > > > > > --- a/tests/Makefile.include > > > > > > +++ b/tests/Makefile.include > > > > > > @@ -109,7 +109,7 @@ $(FUNCTIONAL_TARGETS): > > > > > > @$(MAKE) SPEED=thorough $(subst -functional,-func,$@) > > > > > > .PHONY: check-functional > > > > > > -check-functional: > > > > > > +check-functional: check-venv > > > > > > > > > > I just noticed that there's still a problem: If you run "make > > > > > check-functional-aarch64" immediately after configuring + compiling QEMU in > > > > > a fresh folder for the first time, the functional tests fail with: > > > > > > > > > > ModuleNotFoundError: No module named 'pygdbmi' > > > > > > > > > > We either need to add dependencies to the check-functional-<arch> targets, > > > > > too, or we have to make sure that tests still get properly skipped in the > > > > > case that pygdbmi has not been installed into the venv yet. > > > > > > > > We already have a decorator for skipping tests when modules are missing, > > > > so we should add usage of that. > > > > > > Ack ... and the "from .gdb import GDB" in qemu_test/__init__.py likely also > > > has to go away, to avoid that each and every test tries to pull in the gdb > > > code. > > > > Or alternatively the gdb module can move the gdbmi import so that it is > > only referenced in method scope, so it becomes relevant only when > > executed. > > I can´t follow what you meant here. Do mind expanding on it a bit? The code currently does: from pygdbmi.gdbcontroller import GdbController class GDB: def __init__(self, gdb_path, echo=True, suffix='# ', prompt="$ "): gdb_cmd = [gdb_path, "-q", "--interpreter=mi2"] self.gdbmi = GdbController(gdb_cmd) self.echo = echo but it could instead do class GDB: def __init__(self, gdb_path, echo=True, suffix='# ', prompt="$ "): gdb_cmd = [gdb_path, "-q", "--interpreter=mi2"] from pygdbmi.gdbcontroller import GdbController self.gdbmi = GdbController(gdb_cmd) self.echo = echo so pygdbmi is only required if the GDB classs is instantiated by a test, not when 'gdb.py' is imported With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Hi Daniel, On 9/26/25 12:47, Daniel P. Berrangé wrote: > On Fri, Sep 26, 2025 at 12:44:58PM -0300, Gustavo Romero wrote: >> Hi Daniel, >> >> On 9/26/25 05:50, Daniel P. Berrangé wrote: >>> On Fri, Sep 26, 2025 at 10:42:22AM +0200, Thomas Huth wrote: >>>> On 26/09/2025 10.37, Daniel P. Berrangé wrote: >>>>> On Fri, Sep 26, 2025 at 10:34:01AM +0200, Thomas Huth wrote: >>>>>> On 26/09/2025 07.15, Gustavo Romero wrote: >>>>>>> Add check-venv target as a dependency for the functional tests. This >>>>>>> causes Python modules listed in pythondeps.toml, under the testdeps >>>>>>> group, to be installed when 'make check-functional' is executed to >>>>>>> prepare and run the functional tests. >>>>>>> >>>>>>> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> >>>>>>> Suggested-by: Thomas Huth <thuth@redhat.com> >>>>>>> --- >>>>>>> tests/Makefile.include | 2 +- >>>>>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>>>>> >>>>>>> diff --git a/tests/Makefile.include b/tests/Makefile.include >>>>>>> index 3538c0c740..d012a9b25d 100644 >>>>>>> --- a/tests/Makefile.include >>>>>>> +++ b/tests/Makefile.include >>>>>>> @@ -109,7 +109,7 @@ $(FUNCTIONAL_TARGETS): >>>>>>> @$(MAKE) SPEED=thorough $(subst -functional,-func,$@) >>>>>>> .PHONY: check-functional >>>>>>> -check-functional: >>>>>>> +check-functional: check-venv >>>>>> >>>>>> I just noticed that there's still a problem: If you run "make >>>>>> check-functional-aarch64" immediately after configuring + compiling QEMU in >>>>>> a fresh folder for the first time, the functional tests fail with: >>>>>> >>>>>> ModuleNotFoundError: No module named 'pygdbmi' >>>>>> >>>>>> We either need to add dependencies to the check-functional-<arch> targets, >>>>>> too, or we have to make sure that tests still get properly skipped in the >>>>>> case that pygdbmi has not been installed into the venv yet. >>>>> >>>>> We already have a decorator for skipping tests when modules are missing, >>>>> so we should add usage of that. >>>> >>>> Ack ... and the "from .gdb import GDB" in qemu_test/__init__.py likely also >>>> has to go away, to avoid that each and every test tries to pull in the gdb >>>> code. >>> >>> Or alternatively the gdb module can move the gdbmi import so that it is >>> only referenced in method scope, so it becomes relevant only when >>> executed. >> >> I can´t follow what you meant here. Do mind expanding on it a bit? > > The code currently does: > > from pygdbmi.gdbcontroller import GdbController > > class GDB: > def __init__(self, gdb_path, echo=True, suffix='# ', prompt="$ "): > gdb_cmd = [gdb_path, "-q", "--interpreter=mi2"] > self.gdbmi = GdbController(gdb_cmd) > self.echo = echo > > but it could instead do > > class GDB: > def __init__(self, gdb_path, echo=True, suffix='# ', prompt="$ "): > gdb_cmd = [gdb_path, "-q", "--interpreter=mi2"] > from pygdbmi.gdbcontroller import GdbController > self.gdbmi = GdbController(gdb_cmd) > self.echo = echo > > > so pygdbmi is only required if the GDB classs is instantiated > by a test, not when 'gdb.py' is imported ah, got it. Thanks for clarification ;) Cheers, Gustavo
On 26/09/2025 07.15, Gustavo Romero wrote: > Add check-venv target as a dependency for the functional tests. This > causes Python modules listed in pythondeps.toml, under the testdeps > group, to be installed when 'make check-functional' is executed to > prepare and run the functional tests. > > Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> > Suggested-by: Thomas Huth <thuth@redhat.com> > --- > tests/Makefile.include | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/Makefile.include b/tests/Makefile.include > index 3538c0c740..d012a9b25d 100644 > --- a/tests/Makefile.include > +++ b/tests/Makefile.include > @@ -109,7 +109,7 @@ $(FUNCTIONAL_TARGETS): > @$(MAKE) SPEED=thorough $(subst -functional,-func,$@) > > .PHONY: check-functional > -check-functional: > +check-functional: check-venv > @$(NINJA) precache-functional > @QEMU_TEST_NO_DOWNLOAD=1 $(MAKE) SPEED=thorough check-func check-func-quick Reviewed-by: Thomas Huth <thuth@redhat.com>
© 2016 - 2025 Red Hat, Inc.