tests: functional: Add enable-all-apps script

[sunil]

- Move the script to plinth/tests/functional directory as it is the right place
for it.

- Add HACKING.md entry to talk about the script.

- Update the pyproject.toml to ensure that functional tests config.ini is
installed along with functional tests python code.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy 2025-03-15 07:48:10 -04:00 committed by Sunil Mohan Adapa
parent 5a9d5730a7
commit c7673e039d
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
3 changed files with 50 additions and 1 deletions

View File

@ -589,6 +589,19 @@ installed.
$ py.test-3 -n 4 --dist=loadfile --include-functional -m essential
```
#### Enabling all apps
When testing distribution upgrades from a stable release to next stable release
or testing, it is beneficial to install all available FreedomBox applications.
There is a script available to perform operation.
In the VM or container, run the following command:
```
guest$ cd /freedombox
guest$ sudo make build install
guest$ plinth/tests/functional/enable-all-apps
```
[back to index](#hacking)

View File

@ -0,0 +1,31 @@
#!/usr/bin/python3
#
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# Set FREEDOMBOX_URL to the URL of the FreedomBox on which
# all apps will be enabled.
from splinter import Browser
from plinth import app as app_module, module_loader
from plinth.tests.functional import app_enable, install, login
module_loader.load_modules()
app_module.apps_init()
browser = Browser('firefox')
login(browser)
for app in app_module.App.list():
app_name = app.app_id
try:
# Some apps cannot be installed.
install(browser, app_name)
except:
pass
try:
app_enable(browser, app_name)
except:
# Some apps cannot be enabled.
pass

View File

@ -112,7 +112,12 @@ version = {attr = "plinth.__version__"}
include = ["plinth", "plinth.*"]
[tool.setuptools.package-data]
"*" = ["templates/*", "static/**", "locale/*/LC_MESSAGES/*.mo"]
"*" = [
"templates/*",
"static/**",
"locale/*/LC_MESSAGES/*.mo",
"tests/functional/config.ini"
]
[tool.setuptools.exclude-package-data]
"*" = ["*/data/*"]