Skip to content
Snippets Groups Projects
Commit c44304f9 authored by Guido Gunther's avatar Guido Gunther 💤
Browse files

Update timeout patches

Use the versions posted upstream plus a longer timeout since
arm64 is still too slow.
parent 4b2fb8d1
No related branches found
No related tags found
1 merge request!19Update to 40
From: =?utf-8?q?Guido_G=C3=BCnther?= <agx@sigxcpu.org>
Date: Wed, 24 Feb 2021 14:58:58 +0100
Subject: tests: Split client and JS tests
This gives each suite a longer time and keeps things separate.
Suggested in https://gitlab.gnome.org/GNOME/geary/-/merge_requests/670
(cherry picked from commit fb3642149a5f0bb17e139ff166c446de4e8e90fb)
---
test/meson.build | 34 +++++++++++++++++++++++++
test/test-client.vala | 7 ------
test/test-js.vala | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 103 insertions(+), 7 deletions(-)
create mode 100644 test/test-js.vala
diff --git a/test/meson.build b/test/meson.build
index dd1ce68..8adfd81 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -101,6 +101,20 @@ test_client_sources = [
geary_resources
]
+test_js_sources = [
+ 'test-case.vala',
+ 'test-js.vala',
+
+ 'client/components/components-web-view-test-case.vala',
+
+ 'js/components-page-state-test.vala',
+ 'js/composer-page-state-test.vala',
+ 'js/conversation-page-state-test.vala',
+
+ geary_compiled_schema,
+ geary_resources
+]
+
test_integration_sources = [
'test-case.vala',
'test-integration.vala',
@@ -151,6 +165,21 @@ test_client_bin = executable('test-client',
build_rpath: client_build_dir,
)
+test_js_dependencies = [
+ client_internal_dep,
+ vala_unit_dep,
+]
+test_js_dependencies += client_dependencies
+
+test_js_bin = executable('test-js',
+ test_js_sources + libmock_sources,
+ dependencies: test_js_dependencies,
+ include_directories: config_h_dir,
+ vala_args: geary_vala_args,
+ c_args: geary_c_args,
+ build_rpath: client_build_dir,
+)
+
# Integration tests
test_integration_bin = executable('test-integration',
@@ -178,3 +207,8 @@ test(
test_client_bin,
depends: [ client_lib, web_process ]
)
+test(
+ 'js-tests',
+ test_js_bin,
+ depends: [ client_lib, web_process ]
+)
diff --git a/test/test-client.vala b/test/test-client.vala
index 08949b4..f93ddc9 100644
--- a/test/test-client.vala
+++ b/test/test-client.vala
@@ -62,18 +62,11 @@ int main(string[] args) {
client.add_suite(new Util.Email.Test().suite);
client.add_suite(new Util.JS.Test().suite);
- TestSuite js = new TestSuite("js");
-
- js.add_suite(new Components.PageStateTest().suite);
- js.add_suite(new Composer.PageStateTest().suite);
- js.add_suite(new ConversationPageStateTest().suite);
-
/*
* Run the tests
*/
TestSuite root = TestSuite.get_root();
root.add_suite(client);
- root.add_suite(js);
int ret = -1;
Idle.add(() => {
diff --git a/test/test-js.vala b/test/test-js.vala
new file mode 100644
index 0000000..998ff10
--- /dev/null
+++ b/test/test-js.vala
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2016-2017 Michael Gratton <mike@vee.net>
+ *
+ * This software is licensed under the GNU Lesser General Public License
+ * (version 2.1 or later). See the COPYING file in this distribution.
+ */
+
+
+int main(string[] args) {
+ /*
+ * Set env vars right up front to avoid weird bugs
+ */
+
+ // Use the memory GSettings DB so we a) always start with default
+ // values, and b) don't persist any changes made during a test
+ Environment.set_variable("GSETTINGS_BACKEND", "memory", true);
+
+ // Let GSettings know where to find the dev schema
+ Environment.set_variable("GSETTINGS_SCHEMA_DIR", _GSETTINGS_DIR, true);
+
+ /*
+ * Initialise all the things.
+ */
+
+ // Ensure things like e.g. GLib's formatting routines uses a
+ // well-known UTF-8-based locale rather ASCII. Would like to use
+ // C.UTF-8 here, but currently only Debian et al and Fedora ship
+ // it, and as of Fedora 32 they disagree on collation order for
+ // non-ASCII chars.
+ GLib.Intl.setlocale(LocaleCategory.ALL, "en_US.UTF-8");
+
+ Gtk.init(ref args);
+ Test.init(ref args);
+
+ IconFactory.init(GLib.File.new_for_path(_SOURCE_ROOT_DIR));
+ Geary.RFC822.init();
+ Geary.HTML.init();
+ Geary.Logging.init();
+ if (GLib.Test.verbose()) {
+ GLib.Log.set_writer_func(Geary.Logging.default_log_writer);
+ Geary.Logging.log_to(GLib.stdout);
+ }
+
+ /*
+ * Hook up all tests into appropriate suites
+ */
+
+ TestSuite js = new TestSuite("js");
+
+ js.add_suite(new Components.PageStateTest().suite);
+ js.add_suite(new Composer.PageStateTest().suite);
+ js.add_suite(new ConversationPageStateTest().suite);
+
+ /*
+ * Run the tests
+ */
+ TestSuite root = TestSuite.get_root();
+ root.add_suite(js);
+
+ int ret = -1;
+ Idle.add(() => {
+ ret = Test.run();
+ Gtk.main_quit();
+ return false;
+ });
+
+ Gtk.main();
+ return ret;
+}
From: =?utf-8?q?Guido_G=C3=BCnther?= <agx@sigxcpu.org>
Date: Mon, 5 Jul 2021 11:47:19 +0200
Subject: tests/client: Make sure WebView tests load resources
Without that the client tests fail like
** (test-client:74671): CRITICAL **: 11:32:40.613: void webkit_user_content_manager_add_style_sheet(WebKitUserContentManager*, WebKitUserStyleSheet*): assertion 'styleSheet' failed
This was so far masked since the composer-page-state-test JS tests did
that but test suites should be independent.
(cherry picked from commit fe30e49b747cb16c25ba9f4ae32350b93dd70c49)
---
test/client/composer/composer-web-view-test.vala | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/test/client/composer/composer-web-view-test.vala b/test/client/composer/composer-web-view-test.vala
index 31005d5..8d02f0d 100644
--- a/test/client/composer/composer-web-view-test.vala
+++ b/test/client/composer/composer-web-view-test.vala
@@ -24,6 +24,12 @@ public class Composer.WebViewTest : Components.WebViewTestCase<Composer.WebView>
add_test("get_text_with_url_link", get_text_with_named_link);
add_test("get_text_with_surrounding_nbsps", get_text_with_surrounding_nbsps);
add_test("update_signature", update_signature);
+
+ try {
+ WebView.load_resources();
+ } catch (Error err) {
+ GLib.assert_not_reached();
+ }
}
public void load_resources() throws Error {
From: =?utf-8?q?Guido_G=C3=BCnther?= <agx@sigxcpu.org>
Date: Thu, 22 Jul 2021 20:28:23 +0200
Subject: Add timeout
arm64 is still too slow
---
test/meson.build | 3 +++
1 file changed, 3 insertions(+)
diff --git a/test/meson.build b/test/meson.build
index 8adfd81..640def3 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -200,15 +200,18 @@ test_integration_bin = executable('test-integration',
test(
'engine-tests',
test_engine_bin,
+ timeout: 300,
depends: [ engine_lib ]
)
test(
'client-tests',
test_client_bin,
+ timeout: 300,
depends: [ client_lib, web_process ]
)
test(
'js-tests',
test_js_bin,
+ timeout: 300,
depends: [ client_lib, web_process ]
)
From: =?utf-8?q?Guido_G=C3=BCnther?= <agx@sigxcpu.org>
Date: Wed, 24 Feb 2021 14:58:58 +0100
Subject: tests: Use longer timeout for client tests
The client-tests need about 90s on my arm64 hardware so 120s (instead of
the default 30s) looks save while not being too long in case of a
deadlock.
---
test/meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/meson.build b/test/meson.build
index a4fe2c2..f962324 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -169,4 +169,4 @@ test_integration_bin = executable('test-integration',
)
test('engine-tests', test_engine_bin)
-test('client-tests', test_client_bin)
+test('client-tests', test_client_bin, timeout: 300)
pureos/mr/tests-Use-longer-timeout-for-client-tests.patch
pureos/desktop-file-Add-X-Purism-Form-Factor.patch
pureos/backports/tests-client-Make-sure-WebView-tests-load-resources.patch
pureos/backports/tests-Split-client-and-JS-tests.patch
pureos/hacks/Add-timeout.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment