[gnome-software/fedora-self-tests-skip: 50/50] fedora-langpacks: Skip self tests under non-fedora distros




commit 74733857d31452166a507dbc4192a86355231115
Author: Phaedrus Leeds <matthew leeds endlessm com>
Date:   Mon Aug 10 16:52:29 2020 -0700

    fedora-langpacks: Skip self tests under non-fedora distros
    
    The fedora-langpacks plugin disables itself if not on fedora. Skip the
    self tests in that situation as well so they don't fail. The reason this
    hasn't caused CI failures is that we have "--no-suite fedora-langpacks"
    in .gitlab-ci.yml so that it doesn't run under Debian. But it still
    seems worth skipping as people may run the tests manually, and we need
    to skip it in the downstream Endless CI.

 plugins/fedora-langpacks/gs-self-test.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/plugins/fedora-langpacks/gs-self-test.c b/plugins/fedora-langpacks/gs-self-test.c
index ac8c176d..ae2344ce 100644
--- a/plugins/fedora-langpacks/gs-self-test.c
+++ b/plugins/fedora-langpacks/gs-self-test.c
@@ -22,6 +22,13 @@ gs_plugins_fedora_langpacks_func (GsPluginLoader *plugin_loader)
        g_autoptr(GsApp) app = NULL;
        g_autoptr(GsAppList) list = NULL;
        g_autoptr(GsPluginJob) plugin_job = NULL;
+       g_autoptr(GsOsRelease) os_release = NULL;
+
+       os_release = gs_os_release_new (NULL);
+       if (g_strcmp0 (gs_os_release_get_id (os_release), "fedora") != 0) {
+               g_test_skip ("not on fedora");
+               return;
+       }
 
        /* start with a clean slate */
        cachefn = gs_utils_get_cache_filename ("langpacks", "langpacks-ja",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]