summaryrefslogtreecommitdiff
path: root/uitest/test_main.py
AgeCommit message (Collapse)Author
2023-03-20uitest: add a way to optionally use the same soffice process for a testsuiteMiklos Vajna
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>
2022-05-17Improve version checkMike Kaganski
... to not break on e.g. 4.0 Change-Id: I5b93f6138a5ca85891d2d60beca098b6bcfc15d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134435 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-17use exec_module on newer Python (>3.3) to avoid DeprecationWarningNoel Grandin
Change-Id: I7d0624f63e5d123d5013c14aa0f23355cd42dd0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134466 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-25uitest: unify code and use while True everywhereXisco Fauli
No need for MAX_WAIT anymore Change-Id: Ia063068bd7c47f79d8991922086c22250c01f77d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130527 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-02-25uitest: remove debug optionXisco Fauli
it does nothing Change-Id: I6fa67aa42b1de6199cbb49100624826f5b3b77d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130524 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-02-03ignore ~ backup files when searching for .py uitest filesLuboš Luňák
Change-Id: I9b476336349b67d3d9bb149d4ad4824740797eb0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129370 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-06-28uitest: log the active UITEST_TEST_NAMEJan-Marek Glogowski
From the original commit bff02d54960b55e16d5c1220719bb86dc1fdd205 ("uitests - error if UITEST_TEST_NAME not set to anything useful"), it doesn't look like logging the test_name_limit_found is needed. Change-Id: Ibe1e6a5d63a968b06c4c8e8b4979d5b8caf8f54c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118016 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> Tested-by: Jenkins
2020-11-05Make order of UITest *.py test file processing deterministicStephan Bergmann
...hoping that this can prevent issues like the one seen with 1b0eb76eb1787d9d9fbd7a7a73ee8ae47b62dc33 "tdf#137617: sc: Add UItest" followed by d1232ee6b5e5cc3c811ef3ad72c83e9bd884bfe3 "uitest: reset formula syntax back to Calc A1" (i.e., where the first commit's Gerrit Jenkins build had apparently only succeeded because it happened to run the tests in one specific order, different from the order in which later, failing builds ran it) Change-Id: I4f1b5ada10d60e77b45a0edeb89069fe9376b63e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105325 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-10-27uitest: move all calc tests to sc/qa/uitestXisco Fauli
and remove a few duplicated ones Change-Id: I409ca78dcd7a67e993f6b3a1493ffa6fefd127b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104864 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2020-02-19uitest: make sure UITEST_TEST_NAME matches exactly one test functionMiklos Vajna
So that something like: make -sr UITest_cui_dialogs UITEST_TEST_NAME="chardlg.Test.testSvxCharEffectsPageWriterAutomatic" Only executes testSvxCharEffectsPageWriterAutomatic, not testSvxCharEffectsPageWriter and testSvxCharEffectsPage as well. Change-Id: I0ed334259634e3b9b0db45d9f8462eb4accc689e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88987 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-11-18Fix 'is' operator for comparisonJens Carl
The 'is' operator should not be used for comparison on some types of literals. In CPython this works by accident and CPython 3.8 introduced a SyntaxWarning (see https://bugs.python.org/issue34850). Change-Id: Ic4ba481579d13fd1496431ded59dd626a05fc0c6 Reviewed-on: https://gerrit.libreoffice.org/83033 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2019-07-15uitest: don't complain about the silly VIM swap filesMichael Stahl
Very annoying to have the test not run if you look at its code. Change-Id: Ied63432e0a0460ed66bad4cc53f4769810f058e8 Reviewed-on: https://gerrit.libreoffice.org/75515 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-01-14uitest: fail early in case a test file would be ignoredMiklos Vajna
So the mistake I did in commit 457acbfa304ac8bda0755c9ca8f1e1e22e490ac8 (UITest_writer_tests: split this into 4 parts, 2018-07-03) does not happen again. Change-Id: Ia28ed1fe9909d9c46ebe95d3a1926b0dced46140 Reviewed-on: https://gerrit.libreoffice.org/66180 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-07-10uitests - error if UITEST_TEST_NAME not set to anything usefulNoel Grandin
so the next poor sod who doesn't understand the instructions doesn't waste time with the wrong way of specifying the tests Change-Id: I9759c7f792ec80d660f70f79dc6e2589d44e360f Reviewed-on: https://gerrit.libreoffice.org/57177 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-06uitest: improve conditional test suppression to limit by class and by functionMiklos Vajna
Example: make UITest_writerperfect_epubexport UITEST_TEST_NAME="epubexport.EPUBExportTest.testUIComponent" Change-Id: I7960a71574d8d3d9cb06399813c7370700579c3d Reviewed-on: https://gerrit.libreoffice.org/49246 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-12-02provide a way to limit the UI tests through envMarkus Mohrhard
Change-Id: If0af462f20f3541a183e00732944b0650d94639d Reviewed-on: https://gerrit.libreoffice.org/31512 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-10-26normalize existing emacs/vim mode-lines in python filesMichael Stahl
Bunch of these were setting C++ or Make modes and icky tabs... Also, reportedly Emacs can figure out to enable python-mode automatically. Change-Id: I50072488fb92cb4d27aa3f74f717a28ae3967543
2016-10-11make it easier to read the logsMarkus Mohrhard
Not yet perfect but already better. Change-Id: I5309947333aa2cce6526335b603ef316226e490c
2016-07-10uitest: support the gdb param also in the uitest runnerMarkus Mohrhard
Change-Id: I86833d9fdf42199480f1d448c56e63ff22d4923e
2016-06-26uitest: add a way to have sleeps in some test runsMarkus Mohrhard
Now adding a -d or --debug to the command line options will enable the sleeps in the uitest.debug part. This makes it much easier to debug a test in the visual mode. Only remaining part is now to add a test runner into the build system that makes use of that mode. Change-Id: I03d55b10f06dd12a63a8d87c135967901bef0fba
2016-06-26uitest: bring some order into the file messMarkus Mohrhard
The uitest/uitest directory will be used for the actual uitest framework. The libreoffice directory should contain any common LibreOffice related code. Change-Id: I3f6394ff4be83b89a8764eab10a154e755237d35
2016-06-25uitest: add a mode to just run one fileMarkus Mohrhard
Change-Id: I99906dfc34ebcb7ab0ce76ca446435ae0902443f
2016-06-24uitest: also print number of skipped testsMarkus Mohrhard
Change-Id: I7fbc6513358be252b091154b5ed44d10c8f51c4f
2016-06-23uitest: improve the message of the ui test runnerMarkus Mohrhard
Change-Id: I5026590506b4ddf3db95fb14fe6b0890255a5a25
2016-06-22uitest: remove debug print statementsMarkus Mohrhard
Change-Id: I7dc68ef48a69f4878a20e6cb1dd3203dfc3097fd
2016-06-22uitest: start the switch to python's unittestMarkus Mohrhard
Change-Id: Ic6e0d99a567b7080928accb61ed036b1c25ec7ff