[gnome-software/wip/improve-tests: 472/475] flatpak: Remove checking the apps' progress in the tests



commit 68eba09ba108b19e29c61587383f86afa682c6c1
Author: Joaquim Rocha <jrocha endlessm com>
Date:   Mon May 14 14:22:57 2018 +0200

    flatpak: Remove checking the apps' progress in the tests
    
    The progress was being checked after apps were installed in the unit
    tests, but this may fail depending on the versions of Flatpak/ostree
    since it is managed by those libraries, and it should not be the
    responsibility of the Flatpak plugin to test the progress in any case.
    This patch thus removes the mentioned checks.

 plugins/flatpak/gs-self-test.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/plugins/flatpak/gs-self-test.c b/plugins/flatpak/gs-self-test.c
index 933d70e0..d3757f6c 100644
--- a/plugins/flatpak/gs-self-test.c
+++ b/plugins/flatpak/gs-self-test.c
@@ -370,7 +370,6 @@ gs_plugins_flatpak_app_with_runtime_func (GsPluginLoader *plugin_loader)
        g_assert (ret);
        g_assert_cmpint (gs_app_get_state (app), ==, AS_APP_STATE_INSTALLED);
        g_assert_cmpstr (gs_app_get_version (app), ==, "1.2.3");
-       g_assert_cmpint (gs_app_get_progress (app), ==, 0);
        g_assert_cmpint (gs_app_get_state (runtime), ==, AS_APP_STATE_INSTALLED);
 
        /* check the application exists in the right places */
@@ -424,6 +423,9 @@ gs_plugins_flatpak_app_with_runtime_func (GsPluginLoader *plugin_loader)
        g_assert (!g_file_test (metadata_fn, G_FILE_TEST_IS_REGULAR));
        g_assert (!g_file_test (desktop_fn, G_FILE_TEST_IS_REGULAR));
 
+       /* progress should be set to zero right before installing */
+       g_assert_cmpint (gs_app_get_progress (app), ==, 0);
+
        /* install again, to check whether the progress gets initialized */
        g_object_unref (plugin_job);
        plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_INSTALL,
@@ -431,15 +433,11 @@ gs_plugins_flatpak_app_with_runtime_func (GsPluginLoader *plugin_loader)
                                         NULL);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
 
-       /* progress should be set to zero right before installing */
-       g_assert_cmpint (gs_app_get_progress (app), ==, 0);
-
        gs_test_flush_main_context ();
        g_assert_no_error (error);
        g_assert (ret);
        g_assert_cmpint (gs_app_get_state (app), ==, AS_APP_STATE_INSTALLED);
        g_assert_cmpstr (gs_app_get_version (app), ==, "1.2.3");
-       g_assert_cmpint (gs_app_get_progress (app), ==, 0);
 
        /* remove the application */
        g_object_unref (plugin_job);
@@ -1337,7 +1335,6 @@ gs_plugins_flatpak_app_update_func (GsPluginLoader *plugin_loader)
        g_assert_cmpstr (gs_app_get_version (app), ==, "1.2.3");
        g_assert_cmpstr (gs_app_get_update_version (app), ==, NULL);
        g_assert_cmpstr (gs_app_get_update_details (app), ==, NULL);
-       g_assert_cmpint (gs_app_get_progress (app), ==, 0);
 
        /* switch to the new repo */
        g_assert (unlink ("/var/tmp/self-test/repo") == 0);
@@ -1415,7 +1412,6 @@ gs_plugins_flatpak_app_update_func (GsPluginLoader *plugin_loader)
        g_assert_cmpstr (gs_app_get_version (app), ==, "1.2.4");
        g_assert_cmpstr (gs_app_get_update_version (app), ==, NULL);
        g_assert_cmpstr (gs_app_get_update_details (app), ==, NULL);
-       g_assert_cmpint (gs_app_get_progress (app), ==, 0);
        g_assert (got_progress_installing);
        //g_assert_cmpint (progress_cnt, >, 20); //FIXME: bug in OSTree
        g_assert_cmpint (pending_app_changed_cnt, ==, 0);


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