GNOME Bugzilla – Bug 754093
grilo-plugins tests fail if build machine has no internet connectivity
Last modified: 2015-08-27 15:03:57 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.
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.
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.
Tested with no network connectivity and "make check" pass in grilo-plugins with this patch applied on grilo.
Review of attachment 310052 [details] [review]: It would be necessary to bump glib version in configure.ac
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!)
(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.
(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.
Review of attachment 310052 [details] [review]: yup!