On Sun, Apr 28, 2024 at 06:22:43PM +0200, Thomas Weißschuh wrote:
> On 2024-04-28 17:09:06+0000, Richard W.M. Jones wrote:
> > On Sun, Apr 28, 2024 at 05:44:53PM +0200, Thomas Weißschuh wrote:
> > > The gcs plugin uses the google cloud module and can't work without it.
> > > Skip the test if the module is unavailable.
> > > 
> > > Signed-off-by: Thomas Weißschuh <tho...@t-8ch.de>
> > > ---
> > >  tests/test-gcs.sh | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/tests/test-gcs.sh b/tests/test-gcs.sh
> > > index ed823377dc5a..9b165e8159be 100755
> > > --- a/tests/test-gcs.sh
> > > +++ b/tests/test-gcs.sh
> > > @@ -40,6 +40,7 @@ requires $PYTHON --version
> > >  requires_nbdcopy
> > >  requires_plugin python
> > >  skip_if_valgrind "because Python code leaks memory"
> > > +requires $PYTHON -c 'import google.cloud'
> > 
> > It shouldn't do (I think?) ... Did you see:
> > 
> > https://gitlab.com/nbdkit/nbdkit/-/commit/aca30111632091bbc91096f19638b9e1df7f02b6
> 
> I do have that commit, and I don't have that module installed.
> 
> The actual problem is the import of "google.api_core", which itself is
> part of google-api-core which I don't have installed.
> 
> That is a very narrow band of platforms this test can run on.

It should run without any google.* modules installed, and also if any
combination of google.* modules are installed.  In all cases it ought
to load the mocked module from tests/test-gcs and ignore the installed
google.* modules, or if it can't do that (see my commit message above)
it should skip the test.

For me, that all works.

However I found last week that there's something seriously weird about
the google.* modules (not to mention Python module loading in
general), so I can believe the test might not work in some
combination.

Nevertheless, the commit as proposed is definitely wrong.  The gcs
test does not (or should not) use any installed google.* module, so if
it does then that's a bug of some kind.

What the full log (tests/test-gcs.sh.log) when it fails?

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
nbdkit - Flexible, fast NBD server with plugins
https://gitlab.com/nbdkit/nbdkit
_______________________________________________
Libguestfs mailing list -- guestfs@lists.libguestfs.org
To unsubscribe send an email to guestfs-le...@lists.libguestfs.org

Reply via email to