Merge branch 'feature/designer' into feature/store-i18n

This commit is contained in:
kevinveenbirkenbach committed 2026-10-15 22:59:05 +02:00
commit ac36bc30e0
10 files changed
+83 -16

No files matched your search

@@ -0,0 +1,28 @@
from __future__ import annotations
import unittest
from utils.cache.files import PROJECT_ROOT, read_text
from utils.cache.yaml import load_yaml_str
TASKS = PROJECT_ROOT / "roles/web-app-nextcloud/tasks/addons/onlyoffice.yml"
class TestOnlyofficeCheckDeadline(unittest.TestCase):
def setUp(self) -> None:
self.tasks = load_yaml_str(read_text(str(TASKS)))
def test_the_deadline_is_set_before_the_check(self) -> None:
deadline, check = self.tasks
self.assertIn("nextcloud_onlyoffice_check_deadline", deadline["set_fact"])
self.assertIn("lookup('timeout'", deadline["set_fact"]["nextcloud_onlyoffice_check_deadline"])
self.assertEqual(check["register"], "nextcloud_onlyoffice_check")
def test_the_retries_stop_at_the_deadline(self) -> None:
until = self.tasks[1]["until"]
self.assertIn("nextcloud_onlyoffice_check.rc == 0", until)
self.assertIn("now(utc=true).timestamp() > nextcloud_onlyoffice_check_deadline", until)
if __name__ == "__main__":
unittest.main()
@@ -0,0 +1,24 @@
from __future__ import annotations
import unittest
from utils.cache.files import PROJECT_ROOT, read_text
from utils.cache.yaml import load_yaml_str
ADDON = PROJECT_ROOT / "roles/web-app-nextcloud/meta/addons/onlyoffice.yml"
class TestOnlyofficeConfigurationOrder(unittest.TestCase):
def test_the_document_server_url_is_written_last(self) -> None:
config = load_yaml_str(read_text(str(ADDON)))["config"]["plugin_configuration"]
self.assertEqual(
config[-1]["configkey"],
"DocumentServerUrl",
"a cron.php that caches app config before the last write must see no "
"DocumentServerUrl, or onlyoffice's EditorsCheck runs without jwt_secret "
"and latches settings_error",
)
if __name__ == "__main__":
unittest.main()