After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 754093 - grilo-plugins tests fail if build machine has no internet connectivity
grilo-plugins tests fail if build machine has no internet connectivity
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: plugins
unspecified
Other Linux
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2015-08-25 19:32 UTC by Xavier Claessens
Modified: 2015-08-27 15:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
registry: Use g_strv_contains() (3.54 KB, patch)
2015-08-26 17:24 UTC, Xavier Claessens
committed Details | Review
registry: Fix plugin tests running with mocked network (3.03 KB, patch)
2015-08-26 17:24 UTC, Xavier Claessens
committed Details | Review

Description Xavier Claessens 2015-08-25 19:32:27 UTC
Tests for plugins that require internet connectivity can fake it by setting GRL_NET_MOCKED env var. However grl-registry.c::update_source_visibility() will hide those plugins if the host has no internet while running "make check" and thus they fail.

I think that function should have a special case

  if(g_getenv("GRL_NET_MOCKED") != NULL)
    return;

To not hide plugins that work with mocked network.
Comment 1 Xavier Claessens 2015-08-26 17:24:09 UTC
Created attachment 310052 [details] [review]
registry: Use g_strv_contains()

GNetworkConnectivity was added in glib 2.44, so was g_strv_contains().
No need of a custom implementation here.
Comment 2 Xavier Claessens 2015-08-26 17:24:13 UTC
Created attachment 310053 [details] [review]
registry: Fix plugin tests running with mocked network

Unit tests from grilo-plugins sets GRL_NET_MOCKED env variable
to mock network, so we shouldn't hide those plugins if the host
has no internet connectivity. This can happen on build bots for
example.
Comment 3 Xavier Claessens 2015-08-26 17:35:37 UTC
Tested with no network connectivity and "make check" pass in grilo-plugins with this patch applied on grilo.
Comment 4 Victor Toso 2015-08-27 08:23:38 UTC
Review of attachment 310052 [details] [review]:

It would be necessary to bump glib version in configure.ac
Comment 5 Victor Toso 2015-08-27 08:31:52 UTC
Review of attachment 310053 [details] [review]:

Yes, looks good.

Just to add that It also make sense for some tests to _have_ internet connection in order to verify changes in the content provider. (Like the lyrics one, currently broken!)
Comment 6 Xavier Claessens 2015-08-27 13:12:13 UTC
(In reply to Victor Toso from comment #4)
> Review of attachment 310052 [details] [review] [review]:
> 
> It would be necessary to bump glib version in configure.ac

It's not needed, I use g_strv_contains() in the HAVE_GIO_WITH_NETMON code. And that's enabled only with glib that has GNetworkConnectivityMonitor which is 2.44 already. The configure.ac already checks it.

However, I'm fine having an hard-dep on glib to 2.44 and remove those #if HAVE_GIO_WITH_NETMON. Dunno if that's acceptable dep for master atm.
Comment 7 Victor Toso 2015-08-27 13:34:25 UTC
(In reply to Xavier Claessens from comment #6)
> (In reply to Victor Toso from comment #4)
> > Review of attachment 310052 [details] [review] [review] [review]:
> > 
> > It would be necessary to bump glib version in configure.ac
> 
> It's not needed, I use g_strv_contains() in the HAVE_GIO_WITH_NETMON code.
> And that's enabled only with glib that has GNetworkConnectivityMonitor which
> is 2.44 already. The configure.ac already checks it.

Right!

> 
> However, I'm fine having an hard-dep on glib to 2.44 and remove those #if
> HAVE_GIO_WITH_NETMON. Dunno if that's acceptable dep for master atm.

Me neither. Let's have your patch as it is for now then.
Comment 8 Victor Toso 2015-08-27 13:34:52 UTC
Review of attachment 310052 [details] [review]:

yup!