Bug 161803 - UI tests: infrastructure for environment variables
Summary: UI tests: infrastructure for environment variables
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-26 21:40 UTC by Moritz Duge (allotropia) (a.k.a. kolAflash)
Modified: 2024-08-26 14:17 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Duge (allotropia) (a.k.a. kolAflash) 2024-06-26 21:40:48 UTC
The ui tests may profit from a better infrastructure for setting environment variables.

Currently there seem to be two possibilities to set environment variables needed for UI tests. But I've heard arguments against both.
https://git.libreoffice.org/core/+/3c91fb758a429f51b89dfe9cea088691ced6d0c1/solenv/gbuild/UITest.mk#42
https://git.libreoffice.org/core/+/3c91fb758a429f51b89dfe9cea088691ced6d0c1/uitest/libreoffice/connection.py#95

To me those possibilities don't look ideal.
Please share your opinion. Do you think the existing possibilities are fine? Or do you have in idea how this could be solved in a better way?


Here's an example UITest which needs to set the GNUPGHOME environment variable.
https://gerrit.libreoffice.org/c/core/+/167904
Here it's being done via solenv/gbuild/UITest.mk
https://gerrit.libreoffice.org/c/core/+/167904/4/solenv/gbuild/UITest.mk
And here it's being done via uitest/libreoffice/connection.py
https://gerrit.libreoffice.org/c/core/+/167904/3/uitest/libreoffice/connection.py
Comment 1 Stéphane Guillou (stragu) 2024-07-12 00:30:18 UTC
Xisco, can you please comment on this?
Comment 2 Noel Grandin 2024-08-26 13:45:47 UTC
Probably the best way to do this, is to implement another of our makefile functions, we need

   gb_UITest_add_arguments

which would work the same as

   gb_CppunitTest_add_arguments

where we have similar requirements for some unit tests.

Then we could add the environment variables to the specific UITests that need them in the
  <module>/UITest_<module>_<foo>.mk

files