[gnome-software/misc-flatpak-fixes: 1/6] flatpak: Delete temp installation before each test
- From: Matthew Leeds <mwleeds src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/misc-flatpak-fixes: 1/6] flatpak: Delete temp installation before each test
- Date: Wed, 22 Apr 2020 23:58:45 +0000 (UTC)
commit 24f25400e5852bd88597a02180a590f4f2a84479
Author: Matthew Leeds <matthew leeds endlessm com>
Date: Fri Feb 21 17:08:06 2020 -0800
flatpak: Delete temp installation before each test
It's easier to reason about the unit tests and debug when they fail if
there's less state persisting between them (e.g. a configured
chiron-origin remote in the temp installation which causes
chiron1-origin to be created).
plugins/flatpak/gs-self-test.c | 8 ++++++++
1 file changed, 8 insertions(+)
---
diff --git a/plugins/flatpak/gs-self-test.c b/plugins/flatpak/gs-self-test.c
index 6a1aa74f..8cf6af95 100644
--- a/plugins/flatpak/gs-self-test.c
+++ b/plugins/flatpak/gs-self-test.c
@@ -220,6 +220,7 @@ gs_plugins_flatpak_app_with_runtime_func (GsPluginLoader *plugin_loader)
/* drop all caches */
g_unlink ("/var/tmp/self-test/flatpak-user/components.xmlb");
g_unlink ("/var/tmp/self-test/appstream/components.xmlb");
+ gs_utils_rmtree ("/var/tmp/self-test/flatpak/installation-tmp", NULL);
gs_plugin_loader_setup_again (plugin_loader);
/* no flatpak, abort */
@@ -489,6 +490,7 @@ gs_plugins_flatpak_app_missing_runtime_func (GsPluginLoader *plugin_loader)
/* drop all caches */
g_unlink ("/var/tmp/self-test/flatpak-user/components.xmlb");
g_unlink ("/var/tmp/self-test/appstream/components.xmlb");
+ gs_utils_rmtree ("/var/tmp/self-test/flatpak/installation-tmp", NULL);
gs_plugin_loader_setup_again (plugin_loader);
/* no flatpak, abort */
@@ -637,6 +639,7 @@ gs_plugins_flatpak_runtime_repo_func (GsPluginLoader *plugin_loader)
/* drop all caches */
g_unlink ("/var/tmp/self-test/flatpak-user/components.xmlb");
g_unlink ("/var/tmp/self-test/appstream/components.xmlb");
+ gs_utils_rmtree ("/var/tmp/self-test/flatpak/installation-tmp", NULL);
gs_plugin_loader_setup_again (plugin_loader);
/* write a flatpakrepo file */
@@ -774,6 +777,7 @@ gs_plugins_flatpak_runtime_repo_redundant_func (GsPluginLoader *plugin_loader)
/* drop all caches */
g_unlink ("/var/tmp/self-test/flatpak-user/components.xmlb");
g_unlink ("/var/tmp/self-test/appstream/components.xmlb");
+ gs_utils_rmtree ("/var/tmp/self-test/flatpak/installation-tmp", NULL);
gs_plugin_loader_setup_again (plugin_loader);
/* write a flatpakrepo file */
@@ -929,6 +933,7 @@ gs_plugins_flatpak_broken_remote_func (GsPluginLoader *plugin_loader)
/* drop all caches */
g_unlink ("/var/tmp/self-test/flatpak-user/components.xmlb");
g_unlink ("/var/tmp/self-test/appstream/components.xmlb");
+ gs_utils_rmtree ("/var/tmp/self-test/flatpak/installation-tmp", NULL);
gs_plugin_loader_setup_again (plugin_loader);
/* no flatpak, abort */
@@ -1023,6 +1028,7 @@ gs_plugins_flatpak_ref_func (GsPluginLoader *plugin_loader)
/* drop all caches */
g_unlink ("/var/tmp/self-test/flatpak-user/components.xmlb");
g_unlink ("/var/tmp/self-test/appstream/components.xmlb");
+ gs_utils_rmtree ("/var/tmp/self-test/flatpak/installation-tmp", NULL);
gs_plugin_loader_setup_again (plugin_loader);
/* no flatpak, abort */
@@ -1256,6 +1262,7 @@ gs_plugins_flatpak_app_update_func (GsPluginLoader *plugin_loader)
/* drop all caches */
g_unlink ("/var/tmp/self-test/flatpak-user/components.xmlb");
g_unlink ("/var/tmp/self-test/appstream/components.xmlb");
+ gs_utils_rmtree ("/var/tmp/self-test/flatpak/installation-tmp", NULL);
gs_plugin_loader_setup_again (plugin_loader);
/* no flatpak, abort */
@@ -1504,6 +1511,7 @@ gs_plugins_flatpak_runtime_extension_func (GsPluginLoader *plugin_loader)
/* drop all caches */
g_unlink ("/var/tmp/self-test/flatpak-user/components.xmlb");
g_unlink ("/var/tmp/self-test/appstream/components.xmlb");
+ gs_utils_rmtree ("/var/tmp/self-test/flatpak/installation-tmp", NULL);
gs_plugin_loader_setup_again (plugin_loader);
/* no flatpak, abort */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]