[gnome-software: 10/11] tests: Fix an intermittent test failure when checking keyword searches
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 10/11] tests: Fix an intermittent test failure when checking keyword searches
- Date: Mon, 11 Jul 2022 11:57:03 +0000 (UTC)
commit 5afa1a2d2049697c00d4089d81d6492c363b0a6f
Author: Philip Withnall <pwithnall endlessos org>
Date: Mon Jul 11 10:51:18 2022 +0100
tests: Fix an intermittent test failure when checking keyword searches
The search results weren’t sorted by match value, but a specific result
was expected to be in index 0.
This fixes commit fd1150b904344743f86.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
Helps: #1472
plugins/core/gs-self-test.c | 1 +
plugins/flatpak/gs-self-test.c | 9 +++++++++
plugins/modalias/gs-self-test.c | 1 +
plugins/snap/gs-self-test.c | 1 +
4 files changed, 12 insertions(+)
---
diff --git a/plugins/core/gs-self-test.c b/plugins/core/gs-self-test.c
index d87ea87b5..8266a4c1b 100644
--- a/plugins/core/gs-self-test.c
+++ b/plugins/core/gs-self-test.c
@@ -49,6 +49,7 @@ gs_plugins_core_search_repo_name_func (GsPluginLoader *plugin_loader)
query = gs_app_query_new ("keywords", keywords,
"refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
"dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+ "sort-func", gs_utils_app_sort_match_value,
NULL);
plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
diff --git a/plugins/flatpak/gs-self-test.c b/plugins/flatpak/gs-self-test.c
index dd338c2b2..6f4bd7f41 100644
--- a/plugins/flatpak/gs-self-test.c
+++ b/plugins/flatpak/gs-self-test.c
@@ -355,6 +355,7 @@ gs_plugins_flatpak_app_with_runtime_func (GsPluginLoader *plugin_loader)
query = gs_app_query_new ("keywords", keywords,
"refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
"dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+ "sort-func", gs_utils_app_sort_match_value,
NULL);
plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
g_clear_object (&query);
@@ -376,6 +377,7 @@ gs_plugins_flatpak_app_with_runtime_func (GsPluginLoader *plugin_loader)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
"dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+ "sort-func", gs_utils_app_sort_match_value,
NULL);
plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
g_clear_object (&query);
@@ -607,6 +609,7 @@ gs_plugins_flatpak_app_missing_runtime_func (GsPluginLoader *plugin_loader)
query = gs_app_query_new ("keywords", keywords,
"refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
"dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+ "sort-func", gs_utils_app_sort_match_value,
NULL);
plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
g_clear_object (&query);
@@ -1126,6 +1129,7 @@ flatpak_bundle_or_ref_helper (GsPluginLoader *plugin_loader,
query = gs_app_query_new ("keywords", keywords,
"refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
"dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+ "sort-func", gs_utils_app_sort_match_value,
NULL);
plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
g_clear_object (&query);
@@ -1248,6 +1252,7 @@ flatpak_bundle_or_ref_helper (GsPluginLoader *plugin_loader,
query = gs_app_query_new ("keywords", keywords,
"refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
"dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+ "sort-func", gs_utils_app_sort_match_value,
NULL);
plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
g_clear_object (&query);
@@ -1336,6 +1341,7 @@ flatpak_bundle_or_ref_helper (GsPluginLoader *plugin_loader,
query = gs_app_query_new ("keywords", keywords,
"refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
"dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+ "sort-func", gs_utils_app_sort_match_value,
NULL);
plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
g_clear_object (&query);
@@ -1455,6 +1461,7 @@ gs_plugins_flatpak_app_update_func (GsPluginLoader *plugin_loader)
"refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME,
"dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+ "sort-func", gs_utils_app_sort_match_value,
NULL);
plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
g_clear_object (&query);
@@ -1708,6 +1715,7 @@ gs_plugins_flatpak_runtime_extension_func (GsPluginLoader *plugin_loader)
query = gs_app_query_new ("keywords", keywords,
"refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
"dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+ "sort-func", gs_utils_app_sort_match_value,
NULL);
plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
g_clear_object (&query);
@@ -1843,6 +1851,7 @@ gs_plugins_flatpak_runtime_extension_func (GsPluginLoader *plugin_loader)
query = gs_app_query_new ("keywords", keywords,
"refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME,
"dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+ "sort-func", gs_utils_app_sort_match_value,
NULL);
plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
g_clear_object (&query);
diff --git a/plugins/modalias/gs-self-test.c b/plugins/modalias/gs-self-test.c
index d0d6d8c4e..e2c59da8d 100644
--- a/plugins/modalias/gs-self-test.c
+++ b/plugins/modalias/gs-self-test.c
@@ -27,6 +27,7 @@ gs_plugins_modalias_func (GsPluginLoader *plugin_loader)
query = gs_app_query_new ("keywords", keywords,
"refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_CATEGORIES,
"dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+ "sort-func", gs_utils_app_sort_match_value,
NULL);
plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
list = gs_plugin_loader_job_process (plugin_loader, plugin_job, NULL, &error);
diff --git a/plugins/snap/gs-self-test.c b/plugins/snap/gs-self-test.c
index a2fd4f6d6..e74886634 100644
--- a/plugins/snap/gs-self-test.c
+++ b/plugins/snap/gs-self-test.c
@@ -281,6 +281,7 @@ gs_plugins_snap_test_func (GsPluginLoader *plugin_loader)
"refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_SCREENSHOTS,
"dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+ "sort-func", gs_utils_app_sort_match_value,
NULL);
plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
apps = gs_plugin_loader_job_process (plugin_loader, plugin_job, NULL, &error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]