[geary/mjog/test-split-up] Split up unit tests in build by suite and use of storage



commit b43c1cf4e629b0a5e96226c5c51e57b6b730a0cc
Author: Michael Gratton <mike vee net>
Date:   Fri Oct 11 12:23:22 2019 +1100

    Split up unit tests in build by suite and use of storage
    
    Ensure that test suites that touch storage (database tests, mostly) are
    run by the build individually, so that timeouts apply individually and
    hence give these tests (that can be quite slow on CI machines) some more
    time to run.
    
    Also, split up client tests along cient and js suite lines, also provide a
    meson suite for all tests so tests of the same kind can still be run
    together.

 desktop/meson.build | 44 ++++++++++++++++++++++++++++---------------
 test/meson.build    | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 81 insertions(+), 17 deletions(-)
---
diff --git a/desktop/meson.build b/desktop/meson.build
index f0c8a660..e0c6f105 100644
--- a/desktop/meson.build
+++ b/desktop/meson.build
@@ -1,11 +1,14 @@
 #
-# Desktop files
+# Desktop data files
 #
 
-desktop_output = []
 desktop_conf = configuration_data()
 desktop_conf.set('appid', geary_id)
 
+#
+# Desktop file
+#
+
 desktop_file = i18n.merge_file(
   input: configure_file(
     input: 'org.gnome.Geary.desktop.in.in',
@@ -18,7 +21,19 @@ desktop_file = i18n.merge_file(
   install: true,
   install_dir: join_paths(data_dir, 'applications')
 )
-desktop_output += desktop_file
+
+if desktop_file_validate.found()
+  test(
+    'org.gnome.Geary.desktop-validate',
+    desktop_file_validate,
+    args: [ desktop_file.full_path() ],
+    suite: ['desktop']
+  )
+endif
+
+#
+# Autostart file
+#
 
 autostart_file = i18n.merge_file(
   input: configure_file(
@@ -32,17 +47,15 @@ autostart_file = i18n.merge_file(
   install: true,
   install_dir: join_paths(data_dir, 'applications')
 )
-desktop_output += autostart_file
-
-foreach desktop_file: desktop_output
-  if desktop_file_validate.found()
-    test(
-      'desktop-file-validate',
-      desktop_file_validate,
-      args: [ desktop_file.full_path() ]
-    )
-  endif
-endforeach
+
+if desktop_file_validate.found()
+  test(
+    'geary-autostart.desktop-validate',
+    desktop_file_validate,
+    args: [ autostart_file.full_path() ],
+    suite: ['desktop']
+  )
+endif
 
 #
 # Appdata file
@@ -69,7 +82,8 @@ if appstream_util.found()
     appstream_util,
     args: [
       'validate-relax', '--nonet', appdata_merged.full_path()
-    ]
+    ],
+    suite: ['desktop']
   )
 endif
 
diff --git a/test/meson.build b/test/meson.build
index e8f013fc..80b762ef 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -176,5 +176,55 @@ geary_test_integration_bin = executable('test-integration',
   c_args: geary_c_args,
 )
 
-test('engine-tests', geary_test_engine_bin)
-test('client-tests', geary_test_client_bin)
+# Test harnesses
+
+# Tests that use storage can run exceptionally slow under CI
+# and other automated buid systems. Break them out into individual
+# tests so that each gets its own timeout.
+engine_storage_tests = [
+  'Geary.ContactStoreImplTest',
+  'Geary.Db.DatabaseTest',
+  'Geary.Db.VersionedDatabaseTest',
+  'Geary.ImapDB.AccountTest',
+  'Geary.ImapDB.AttachmentTest',
+  'Geary.ImapDB.AttachmentIoTest',
+  'Geary.ImapDB.DatabaseTest',
+  'Geary.ImapDB.FolderTest',
+]
+
+test_engine_args = []
+foreach name: engine_storage_tests
+  test_engine_args += '-s'
+  test_engine_args += '/engine/' + name
+endforeach
+
+test(
+  'engine-tests',
+  geary_test_engine_bin,
+  args: test_engine_args,
+  suite: ['engine']
+)
+
+foreach name: engine_storage_tests
+  test(
+    'engine-' + name.to_lower(),
+    geary_test_engine_bin,
+    args: ['-p', '/engine/' + name],
+    timeout: 300,
+    suite: ['engine']
+  )
+endforeach
+
+test(
+  'client-tests',
+  geary_test_client_bin,
+  args: ['-p', '/client'],
+  suite: ['client']
+)
+
+test(
+  'js-tests',
+  geary_test_client_bin,
+  args: ['-p', '/js'],
+  suite: ['client']
+)


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