[gnome-software/wip/mcrha/ci-test] more tests



commit b624284215efd33006224f62e81288359d66984a
Author: Milan Crha <mcrha redhat com>
Date:   Wed Mar 16 17:09:29 2022 +0100

    more tests

 .gitlab-ci.yml                           |  2 +-
 plugins/flatpak/gs-flatpak-transaction.c | 35 +++++++++++++++++---------------
 plugins/flatpak/gs-self-test.c           | 12 +++++------
 3 files changed, 26 insertions(+), 23 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9c9022cc1..147aed1ce 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -20,7 +20,7 @@ variables:
 
 fedora-x86_64:
   extends: .build
-  image: registry.gitlab.gnome.org/gnome/gnome-software/fedora:v10
+  image: registry.gitlab.gnome.org/gnome/gnome-software/fedora:v9
   stage: build
   except:
     - tags
diff --git a/plugins/flatpak/gs-flatpak-transaction.c b/plugins/flatpak/gs-flatpak-transaction.c
index c8d273007..94a89495b 100644
--- a/plugins/flatpak/gs-flatpak-transaction.c
+++ b/plugins/flatpak/gs-flatpak-transaction.c
@@ -102,11 +102,11 @@ gs_flatpak_transaction_run (FlatpakTransaction *transaction,
        GsFlatpakTransaction *self = GS_FLATPAK_TRANSACTION (transaction);
        g_autoptr(GError) error_local = NULL;
 
-       g_message ("   zzz %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("   zzz %s: %d +++ main-context:%p thread-def:%p same:%d\n", __FUNCTION__, __LINE__, 
g_main_context_default (), g_main_context_get_thread_default (), g_main_context_default () == 
g_main_context_get_thread_default ());
        if (!flatpak_transaction_run (transaction, cancellable, &error_local)) {
                /* whole transaction failed; restore the state for all the apps involved */
                g_autolist(GObject) ops = NULL;
-       g_message ("   zzz %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("   zzz %s: %d failed:%s\n", __FUNCTION__, __LINE__, error_local ? error_local->message : 
"???");
                ops = flatpak_transaction_get_operations (transaction);
        g_message ("   zzz %s: %d\n", __FUNCTION__, __LINE__);
                for (GList *l = ops; l != NULL; l = l->next) {
@@ -119,7 +119,7 @@ gs_flatpak_transaction_run (FlatpakTransaction *transaction,
                        }
                        gs_app_set_state_recover (app);
                }
-       g_message ("   zzz %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("   zzz %s: %d --- (in failed)\n", __FUNCTION__, __LINE__);
 
                if (self->first_operation_error != NULL) {
                        g_propagate_error (error, g_steal_pointer (&self->first_operation_error));
@@ -129,7 +129,7 @@ gs_flatpak_transaction_run (FlatpakTransaction *transaction,
                        return FALSE;
                }
        }
-       g_message ("   zzz %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("   zzz %s: %d ---\n", __FUNCTION__, __LINE__);
 
        return TRUE;
 }
@@ -139,12 +139,14 @@ _transaction_ready (FlatpakTransaction *transaction)
 {
        GsFlatpakTransaction *self = GS_FLATPAK_TRANSACTION (transaction);
        g_autolist(GObject) ops = NULL;
-       g_message ("   aaa %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("   aaa %s: %d +++\n", __FUNCTION__, __LINE__);
 
        /* nothing to do */
        ops = flatpak_transaction_get_operations (transaction);
-       if (ops == NULL)
+       if (ops == NULL) {
+               g_message ("   aaa %s: %d --- no ops\n", __FUNCTION__, __LINE__);
                return TRUE; // FIXME: error?
+       }
        g_message ("   aaa %s: %d\n", __FUNCTION__, __LINE__);
        for (GList *l = ops; l != NULL; l = l->next) {
                FlatpakTransactionOperation *op = l->data;
@@ -186,7 +188,7 @@ _transaction_ready (FlatpakTransaction *transaction)
                }
        g_message ("   aaa %s: %d\n", __FUNCTION__, __LINE__);
        }
-       g_message ("   aaa %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("   aaa %s: %d ---\n", __FUNCTION__, __LINE__);
        return TRUE;
 }
 
@@ -376,7 +378,7 @@ _transaction_progress_changed_cb (FlatpakTransactionProgress *progress,
        GsApp *app = data->app;
        GsFlatpakTransaction *self = data->transaction;
        g_autolist(FlatpakTransactionOperation) ops = NULL;
-       g_message ("   aaa %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("   aaa %s: %d +++\n", __FUNCTION__, __LINE__);
 
        if (flatpak_transaction_progress_get_is_estimating (progress)) {
                /* "Estimating" happens while fetching the metadata, which
@@ -384,7 +386,7 @@ _transaction_progress_changed_cb (FlatpakTransactionProgress *progress,
                 * each operation. At this point, no more detailed progress
                 * information is available. */
                gs_app_set_progress (app, GS_APP_PROGRESS_UNKNOWN);
-       g_message ("   aaa %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("   aaa %s: %d --- estimated\n", __FUNCTION__, __LINE__);
                return;
        }
 
@@ -414,7 +416,7 @@ _transaction_progress_changed_cb (FlatpakTransactionProgress *progress,
        g_message ("   aaa %s: %d\n", __FUNCTION__, __LINE__);
        ops = flatpak_transaction_get_operations (FLATPAK_TRANSACTION (self));
        update_progress_for_op_recurse_up (self, progress, ops, data->operation, data->operation);
-       g_message ("   aaa %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("   aaa %s: %d ---\n", __FUNCTION__, __LINE__);
 }
 
 static const gchar *
@@ -446,12 +448,12 @@ _transaction_new_operation (FlatpakTransaction *transaction,
        GsApp *app;
        g_autoptr(ProgressData) progress_data = NULL;
 
-       g_message ("   aaa %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("   aaa %s: %d +++\n", __FUNCTION__, __LINE__);
        /* find app */
        app = _transaction_operation_get_app (operation);
        if (app == NULL) {
                FlatpakTransactionOperationType ot;
-       g_message ("   aaa %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("   aaa %s: %d --- no app\n", __FUNCTION__, __LINE__);
                ot = flatpak_transaction_operation_get_operation_type (operation);
                g_warning ("failed to find app for %s during %s",
                           flatpak_transaction_operation_get_ref (operation),
@@ -497,7 +499,7 @@ _transaction_new_operation (FlatpakTransaction *transaction,
        default:
                break;
        }
-       g_message ("   aaa %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("   aaa %s: %d ---\n", __FUNCTION__, __LINE__);
 }
 
 static gboolean
@@ -575,12 +577,12 @@ _transaction_operation_done (FlatpakTransaction *transaction,
                             FlatpakTransactionResult details)
 {
        GsFlatpakTransaction *self = GS_FLATPAK_TRANSACTION (transaction);
-       g_message ("   aaa %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("   aaa %s: %d +++\n", __FUNCTION__, __LINE__);
 
        /* invalidate */
        GsApp *app = _transaction_operation_get_app (operation);
        if (app == NULL) {
-       g_message ("   aaa %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("   aaa %s: %d --- no app\n", __FUNCTION__, __LINE__);
                g_warning ("failed to find app for %s",
                           flatpak_transaction_operation_get_ref (operation));
                return;
@@ -617,7 +619,7 @@ _transaction_operation_done (FlatpakTransaction *transaction,
                gs_app_set_state (app, GS_APP_STATE_UNKNOWN);
                break;
        }
-       g_message ("   aaa %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("   aaa %s: %d ---\n", __FUNCTION__, __LINE__);
 }
 
 static gboolean
@@ -793,5 +795,6 @@ gs_flatpak_transaction_new (FlatpakInstallation     *installation,
                               NULL);
        if (self == NULL)
                return NULL;
+       flatpak_transaction_set_disable_prune (FLATPAK_TRANSACTION (self), TRUE);
        return FLATPAK_TRANSACTION (self);
 }
diff --git a/plugins/flatpak/gs-self-test.c b/plugins/flatpak/gs-self-test.c
index 7ebf49c48..110891fb3 100644
--- a/plugins/flatpak/gs-self-test.c
+++ b/plugins/flatpak/gs-self-test.c
@@ -315,7 +315,7 @@ gs_plugins_flatpak_app_with_runtime_func (GsPluginLoader *plugin_loader)
        g_assert_no_error (error);
        g_assert_cmpint (kf_remote_repo_version, ==, 1);
 
-       g_message ("xxx %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("xxx %s: %d before first install main-context:%p thread-def:%p same:%d\n", __FUNCTION__, 
__LINE__, g_main_context_default (), g_main_context_get_thread_default (), g_main_context_default () == 
g_main_context_get_thread_default ());
        /* add a remote */
        app_source = gs_flatpak_app_new ("test");
        testdir = gs_test_get_filename (TESTDATADIR, "app-with-runtime");
@@ -336,7 +336,7 @@ gs_plugins_flatpak_app_with_runtime_func (GsPluginLoader *plugin_loader)
        g_assert_true (ret);
        g_assert_cmpint (gs_app_get_state (app_source), ==, GS_APP_STATE_INSTALLED);
 
-       g_message ("xxx %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("xxx %s: %d after first install main-context:%p thread-def:%p same:%d\n", __FUNCTION__, 
__LINE__, g_main_context_default (), g_main_context_get_thread_default (), g_main_context_default () == 
g_main_context_get_thread_default ());
        /* check remote was set up */
        ret = g_key_file_load_from_file (kf2, config_fn, G_KEY_FILE_NONE, &error);
        g_assert_no_error (error);
@@ -393,7 +393,7 @@ gs_plugins_flatpak_app_with_runtime_func (GsPluginLoader *plugin_loader)
        g_assert_no_error (error);
        g_assert_true (list != NULL);
 
-       g_message ("xxx %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("xxx %s: %d main-context:%p thread-def:%p same:%d\n", __FUNCTION__, __LINE__, 
g_main_context_default (), g_main_context_get_thread_default (), g_main_context_default () == 
g_main_context_get_thread_default ());
        /* make sure there is one entry, the flatpak app */
        g_assert_cmpint (gs_app_list_length (list), ==, 1);
        app = gs_app_list_index (list, 0);
@@ -412,7 +412,7 @@ gs_plugins_flatpak_app_with_runtime_func (GsPluginLoader *plugin_loader)
        g_assert_cmpstr (gs_app_get_update_details_markup (app), ==, NULL);
        g_assert_cmpint (gs_app_get_update_urgency (app), ==, AS_URGENCY_KIND_UNKNOWN);
 
-       g_message ("xxx %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("xxx %s: %d main-context:%p thread-def:%p same:%d\n", __FUNCTION__, __LINE__, 
g_main_context_default (), g_main_context_get_thread_default (), g_main_context_default () == 
g_main_context_get_thread_default ());
        /* check runtime */
        runtime = gs_app_get_runtime (app);
        g_assert_true (runtime != NULL);
@@ -424,9 +424,9 @@ gs_plugins_flatpak_app_with_runtime_func (GsPluginLoader *plugin_loader)
        plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_INSTALL,
                                         "app", app,
                                         NULL);
-       g_message ("xxx %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
+       g_message ("xxx %s: %d app:%p main-context:%p thread-def:%p same:%d\n", __FUNCTION__, __LINE__, app, 
g_main_context_default (), g_main_context_get_thread_default (), g_main_context_default () == 
g_main_context_get_thread_default ());
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
-       g_message ("xxx %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("xxx %s: %d main-context:%p thread-def:%p same:%d\n", __FUNCTION__, __LINE__, 
g_main_context_default (), g_main_context_get_thread_default (), g_main_context_default () == 
g_main_context_get_thread_default ());
        gs_test_flush_main_context ();
        g_message ("xxx %s: %d\n", __FUNCTION__, __LINE__);
        g_assert_no_error (error);


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