summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2023-03-20 08:14:13 +0100
committerMiklos Vajna <vmiklos@collabora.com>2023-03-20 12:40:22 +0000
commitf5d97d14a2169c23b801d5d09ea19c001d36bba1 (patch)
tree74aef51dbd6e5dd48c5c9afed61fe5c123b8b6c8 /solenv
parent48818dd359fbf0f37e1b318de89ab2ea7d735f58 (diff)
uitest: add a way to optionally use the same soffice process for a testsuite
A uitest suite may have several testcases and we spend a lot of time spinning up a new soffice process for each testcase, while we typically do such initialization only once for per testsuites in the cppunit case, slowing down uitests. The problem is that this way today's uitest cases don't really have to clean up after themselves, since they know that the next testcase will gets its own clean state (back to the start center). Fix the problem by adding an opt-in way, so that a uitest suite can declare that it's safe to run the entire suite with the same soffice process. To be more specific: - add a new --oneprocess for test_main.py, which will create a shared connection to a soffice process - UITest then closes the document (returning to the start center) instead of disposing the component in the oneprocess case - UITestCase won't create its own soffice connection in the oneprocess case - add a new gb_UITest_use_oneprocess method to gbuild, to request this new, faster behavior E.g. on my machine this means UITest_sw_styleInspector takes 26,345s instead of 40,652s, probably such a speedup is worth the added complexity. This works nicely when the testsuite is a list of simple/boring test cases, always loading one component/document at a time and always using close_doc() to close it. It may not be safe for testsuites that do something special (they may fail or hang), we'll see. Change-Id: Ib14439d48aa547c92652245ee1c0cf37d2d7b6e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149134 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/UITest.mk6
1 files changed, 6 insertions, 0 deletions
diff --git a/solenv/gbuild/UITest.mk b/solenv/gbuild/UITest.mk
index 0a08939239b8..3b78b1356d90 100644
--- a/solenv/gbuild/UITest.mk
+++ b/solenv/gbuild/UITest.mk
@@ -80,6 +80,7 @@ else
$(gb_TEST_ENV_VARS) \
$(gb_UITest_COMMAND) \
--soffice="$(gb_UITest_SOFFICEARG)" \
+ $(if $(ONEPROCESS),--oneprocess) \
--userdir=$(call gb_Helper_make_url,$(dir $(call gb_UITest_get_target,$*))user) \
--dir=$(strip $(MODULES)) \
$(gb_UITest_GDBTRACE) \
@@ -104,6 +105,7 @@ $(call gb_UITest_get_target,$(1)) : MODULES :=
$(eval $(call gb_TestHelpers_use_more_fonts,$(call gb_UITest_get_target,$(1))))
$(eval $(call gb_Module_register_target,$(call gb_UITest_get_target,$(1)),$(call gb_UITest_get_clean_target,$(1))))
$(call gb_Helper_make_userfriendly_targets,$(1),UITest)
+$(call gb_UITest_get_target,$(1)) : ONEPROCESS := $(false)
endef
@@ -133,6 +135,10 @@ define gb_UITest_use_configuration
$(call gb_UITest_get_target,$(1)) : gb_UITest_use_config := $(2)
endef
+define gb_UITest_use_oneprocess
+$(call gb_UITest_get_target,$(1)) : ONEPROCESS := $(true)
+endef
+
else # DISABLE_PYTHON