[pim/akonadi-e2e-tests] src/akonadi: Make XDG_STATE_DIR point to the temporary directory

Dominique MICHEL <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 6d5fa1c925253747d98191922329087d255203b6 by Dominique MICHEL.
Committed on 20/07/2026 at 14:49.
Pushed by aloeil into branch 'master'.

Make XDG_STATE_DIR point to the temporary directory

M  +5    -0    src/akonadi/env.py
M  +1    -1    src/akonadi/server.py

https://invent.kde.org/pim/akonadi-e2e-tests/-/commit/6d5fa1c925253747d98191922329087d255203b6

diff --git a/src/akonadi/env.py b/src/akonadi/env.py
index c9cea59..f2863a2 100644
--- a/src/akonadi/env.py
+++ b/src/akonadi/env.py
@@ -36,6 +36,10 @@ class AkonadiEnv:
     def tmp_dir(self) -> Path:
         return self._root_path / "tmp"
 
+    @property
+    def xdg_state_home(self) -> Path:
+        return self._root_path / "state"
+
     @property
     def xdg_data_home(self) -> Path:
         return self._root_path / "data"
@@ -64,6 +68,7 @@ class AkonadiEnv:
         env["XDG_CONFIG_HOME"] = str(self.xdg_config_home)
         env["XDG_CACHE_HOME"] = str(self.xdg_cache_home)
         env["XDG_DATA_HOME"] = str(self.xdg_data_home)
+        env["XDG_STATE_HOME"] = str(self.xdg_state_home)
         env["AKONADI_INSTANCE"] = self._instance_id
         env["AKONADI_DISABLE_AGENT_AUTOSTART"] = "true"
         env["LC_ALL"] = "C.UTF-8"
diff --git a/src/akonadi/server.py b/src/akonadi/server.py
index 2185dd4..da4b429 100644
--- a/src/akonadi/server.py
+++ b/src/akonadi/server.py
@@ -59,7 +59,7 @@ class AkonadiServer:
 
     def akonadiconsole_command(self) -> str:
         """Get the command to launch akonadiconsole for debugging purposes."""
-        return f"XDG_CONFIG_HOME={self._env.xdg_config_home} XDG_DATA_HOME={self._env.xdg_data_home} XDG_CACHE_HOME={self._env.xdg_cache_home} HOME={self._env.home_dir} AKONADI_INSTANCE={self._env.instance_id} akonadiconsole"
+        return f"XDG_CONFIG_HOME={self._env.xdg_config_home} XDG_DATA_HOME={self._env.xdg_data_home} XDG_CACHE_HOME={self._env.xdg_cache_home} XDG_STATE_HOME={self._env.xdg_state_home} HOME={self._env.home_dir} AKONADI_INSTANCE={self._env.instance_id} akonadiconsole"
 
     def _prepare_environment(self) -> None:
         """Prepare the environment for the Akonadi server."""
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.