erplibre/test/test_qemu_desktop_tools.py

908 lines
38 KiB
Python
Raw Normal View History

[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
#!/usr/bin/env python3
# © 2026 TechnoLibre (http://www.technolibre.ca)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
"""Outils de développement des VM graphiques : filtrage, disque, commande.
Ce qui se vérifie ici sans VM : qu'un outil demandé pour tout le parc n'atterrit
que sur les machines qui peuvent le recevoir, que la place disque annoncée suit
ce filtrage, et qu'un outil qui échoue ne fait pas tomber l'installation
d'ERPLibre avec lui — celle-ci ayant duré une heure.
"""
[FIX] script todo: ne plus laisser PyCharm manger la compilation mobile Sur erplibre-ubuntu-2604-gnome, l'APK s'est fait tuer par le noyau. La cause est ici : « $! » désigne xvfb-run, un script, et le tuer n'atteint ni PyCharm ni Xvfb — l'IDE tournait encore 45 minutes après son étape, avec 1,9 Go, quand Gradle a demandé ses 6,8 Go sur 12. C'est le GROUPE qu'on tue maintenant, et plus rien ne survit : mesuré, 2 Go rendus. Le .idea n'était jamais écrit non plus : 122 684 des 123 021 fichiers d'assets du dépôt mobile épuisaient les 65 536 watches inotify. Relevées à 524288, le projet se crée. Restent 4 Go de swap avant de compiler, et un diagnostic qui nomme la mémoire — avec le compte de l'oom-killer — puis la limite ZIP de 65 535 entrées, sur laquelle la compilation bute désormais, en amont. --- EN --- On erplibre-ubuntu-2604-gnome the APK was killed by the kernel. The cause is here: "$!" is xvfb-run, a script, and killing it reaches neither PyCharm nor Xvfb — the IDE was still running 45 minutes after its step, holding 1.9 GB, when Gradle asked for its 6.8 GB out of 12. The GROUP is killed now, and nothing survives it: 2 GB given back, measured. The .idea was never written either: 122,684 of the mobile repo's 123,021 asset files exhausted the 65,536 inotify watches. Raised to 524288, the project gets created. Also 4 GB of swap before building, and a diagnostic naming memory — with the oom-killer count — then the 65,535-entry ZIP limit the build now hits, upstream of us. Assisted-by: Claude Opus 5
2026-08-19 05:38:01 -04:00
import pathlib
[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
import subprocess
import sys
import unittest
sys.argv = ["todo.py"]
from script.todo.todo import TODO # noqa: E402
class TestToolFiltering(unittest.TestCase):
def setUp(self):
self.todo = TODO.__new__(TODO)
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
self.all = tuple(TODO._QEMU_VM_TOOLS)
[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
def test_a_server_gets_no_graphical_tool(self):
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
"""Un IDE sans bureau n'a rien pour s'afficher. La compilation mobile,
elle, reste : elle compile, elle n'affiche pas."""
got = self.todo._qemu_tools_for(self.all, "amd64", "", "ubuntu")
for graphical in ("pycharm", "android", "gnome_ext"):
self.assertNotIn(graphical, got)
[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
def test_android_studio_is_x86_64_only(self):
"""Google ne publie aucune archive Linux aarch64 : toutes les variantes
de l'URL rendent 404, et product-info.json ne déclare que Linux/amd64.
"""
self.assertIn(
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
"android",
self.todo._qemu_tools_for(self.all, "amd64", "gnome", "ubuntu"),
[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
)
for arch in ("arm64", "s390x"):
self.assertNotIn(
"android",
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
self.todo._qemu_tools_for(self.all, arch, "gnome", "ubuntu"),
[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
arch,
)
def test_pycharm_follows_jetbrains_two_architectures(self):
for arch in ("amd64", "arm64"):
self.assertIn(
"pycharm",
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
self.todo._qemu_tools_for(self.all, arch, "gnome", "ubuntu"),
[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
arch,
)
self.assertNotIn(
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
"pycharm",
self.todo._qemu_tools_for(self.all, "s390x", "gnome", "ubuntu"),
[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
)
def test_gnome_extensions_only_under_gnome(self):
self.assertIn(
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
"gnome_ext",
self.todo._qemu_tools_for(self.all, "amd64", "gnome", "ubuntu"),
[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
)
self.assertNotIn(
"gnome_ext",
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
self.todo._qemu_tools_for(self.all, "amd64", "cinnamon", "ubuntu"),
[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
)
def test_unknown_key_is_ignored(self):
self.assertEqual(
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
[],
self.todo._qemu_tools_for(("nope",), "amd64", "gnome", "ubuntu"),
[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
)
class TestToolDisk(unittest.TestCase):
def setUp(self):
self.todo = TODO.__new__(TODO)
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
self.all = tuple(TODO._QEMU_VM_TOOLS)
[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
def test_disk_follows_the_filtering(self):
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
"""Une VM qui ne recevra pas un outil ne doit pas se voir gonfler son
disque de sa taille. En arm64 il en manque DEUX : Android Studio, que
Google ne publie qu'en x86_64, et la compilation mobile, qui en
dépend."""
full = self.todo._qemu_tools_disk_gb(
self.all, "amd64", "gnome", "ubuntu"
)
arm = self.todo._qemu_tools_disk_gb(
self.all, "arm64", "gnome", "ubuntu"
)
[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
self.assertEqual(
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
full - arm,
TODO._QEMU_VM_TOOLS["android"]["disk_gb"]
[ADD] todo qemu: add an Android emulator, and fix what the real run exposed Running it on a VM was the only way to find these. install_os never installed python3-venv, so .venv.erplibre was born crippled — bin/python but no pip, no activate — and everything downstream failed on "No module named git"; one line of dependency fixes it. Capacitor 8 needs a JDK 21 where the mobile repository's installer puts 17, and Gradle must RUN on it. That installer is not idempotent either, so it is replayed only when something is missing. The new emulator option creates an AVD from the SDK's own device list — the newest plain Pixel, smallest screen — with software rendering written into its config so ssh -X does not open a black screen, and adds the user to the kvm group, without which it refuses to start. Checked on a VM: boot completed in 10 s, adb sees emulator-5554, Android 16 x86_64, no KVM refusal. Vitest: 1938 tests pass. The APK still fails, upstream: sentencepiece builds protoc for the target then runs it on the host. --- FR --- Seule l'exécution sur une VM pouvait trouver ceci. install_os n'installait pas python3-venv, si bien que .venv.erplibre naissait infirme — bin/python mais ni pip ni activate — et tout ce qui en dépend tombait sur « No module named git » ; une ligne de dépendance suffit. Capacitor 8 réclame un JDK 21 là où l'installateur du dépôt mobile pose un 17, et Gradle doit TOURNER dessus. Cet installateur n'est pas idempotent non plus : il n'est rejoué que s'il manque quelque chose. La nouvelle option crée un AVD depuis la liste de profils du SDK — le Pixel simple le plus récent, plus petit écran —, écrit le rendu logiciel dans sa configuration pour qu'ssh -X n'ouvre pas un écran noir, et ajoute l'utilisateur au groupe kvm, sans quoi il refuse de démarrer. Vérifié sur une VM : boot en 10 s, adb voit emulator-5554, Android 16 x86_64, aucun refus de KVM. Vitest : 1938 tests passent. L'APK échoue encore, en amont : sentencepiece bâtit protoc pour la cible puis l'exécute sur l'hôte. Assisted-by: Claude Opus 5
2026-08-18 02:17:08 -04:00
+ TODO._QEMU_VM_TOOLS["mobile"]["disk_gb"]
+ TODO._QEMU_VM_TOOLS["avd"]["disk_gb"],
[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
)
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
def test_a_server_only_pays_for_what_it_gets(self):
"""Un serveur ne porte aucun IDE, donc il n'en paie pas le disque —
[ADD] todo qemu: add an Android emulator, and fix what the real run exposed Running it on a VM was the only way to find these. install_os never installed python3-venv, so .venv.erplibre was born crippled — bin/python but no pip, no activate — and everything downstream failed on "No module named git"; one line of dependency fixes it. Capacitor 8 needs a JDK 21 where the mobile repository's installer puts 17, and Gradle must RUN on it. That installer is not idempotent either, so it is replayed only when something is missing. The new emulator option creates an AVD from the SDK's own device list — the newest plain Pixel, smallest screen — with software rendering written into its config so ssh -X does not open a black screen, and adds the user to the kvm group, without which it refuses to start. Checked on a VM: boot completed in 10 s, adb sees emulator-5554, Android 16 x86_64, no KVM refusal. Vitest: 1938 tests pass. The APK still fails, upstream: sentencepiece builds protoc for the target then runs it on the host. --- FR --- Seule l'exécution sur une VM pouvait trouver ceci. install_os n'installait pas python3-venv, si bien que .venv.erplibre naissait infirme — bin/python mais ni pip ni activate — et tout ce qui en dépend tombait sur « No module named git » ; une ligne de dépendance suffit. Capacitor 8 réclame un JDK 21 là où l'installateur du dépôt mobile pose un 17, et Gradle doit TOURNER dessus. Cet installateur n'est pas idempotent non plus : il n'est rejoué que s'il manque quelque chose. La nouvelle option crée un AVD depuis la liste de profils du SDK — le Pixel simple le plus récent, plus petit écran —, écrit le rendu logiciel dans sa configuration pour qu'ssh -X n'ouvre pas un écran noir, et ajoute l'utilisateur au groupe kvm, sans quoi il refuse de démarrer. Vérifié sur une VM : boot en 10 s, adb voit emulator-5554, Android 16 x86_64, aucun refus de KVM. Vitest : 1938 tests passent. L'APK échoue encore, en amont : sentencepiece bâtit protoc pour la cible puis l'exécute sur l'hôte. Assisted-by: Claude Opus 5
2026-08-18 02:17:08 -04:00
mais il paie bien ce qu'il reçoit : compilation mobile et émulateur."""
[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
self.assertEqual(
[ADD] todo qemu: add an Android emulator, and fix what the real run exposed Running it on a VM was the only way to find these. install_os never installed python3-venv, so .venv.erplibre was born crippled — bin/python but no pip, no activate — and everything downstream failed on "No module named git"; one line of dependency fixes it. Capacitor 8 needs a JDK 21 where the mobile repository's installer puts 17, and Gradle must RUN on it. That installer is not idempotent either, so it is replayed only when something is missing. The new emulator option creates an AVD from the SDK's own device list — the newest plain Pixel, smallest screen — with software rendering written into its config so ssh -X does not open a black screen, and adds the user to the kvm group, without which it refuses to start. Checked on a VM: boot completed in 10 s, adb sees emulator-5554, Android 16 x86_64, no KVM refusal. Vitest: 1938 tests pass. The APK still fails, upstream: sentencepiece builds protoc for the target then runs it on the host. --- FR --- Seule l'exécution sur une VM pouvait trouver ceci. install_os n'installait pas python3-venv, si bien que .venv.erplibre naissait infirme — bin/python mais ni pip ni activate — et tout ce qui en dépend tombait sur « No module named git » ; une ligne de dépendance suffit. Capacitor 8 réclame un JDK 21 là où l'installateur du dépôt mobile pose un 17, et Gradle doit TOURNER dessus. Cet installateur n'est pas idempotent non plus : il n'est rejoué que s'il manque quelque chose. La nouvelle option crée un AVD depuis la liste de profils du SDK — le Pixel simple le plus récent, plus petit écran —, écrit le rendu logiciel dans sa configuration pour qu'ssh -X n'ouvre pas un écran noir, et ajoute l'utilisateur au groupe kvm, sans quoi il refuse de démarrer. Vérifié sur une VM : boot en 10 s, adb voit emulator-5554, Android 16 x86_64, aucun refus de KVM. Vitest : 1938 tests passent. L'APK échoue encore, en amont : sentencepiece bâtit protoc pour la cible puis l'exécute sur l'hôte. Assisted-by: Claude Opus 5
2026-08-18 02:17:08 -04:00
TODO._QEMU_VM_TOOLS["mobile"]["disk_gb"]
+ TODO._QEMU_VM_TOOLS["avd"]["disk_gb"],
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
self.todo._qemu_tools_disk_gb(self.all, "amd64", "", "ubuntu"),
[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
)
def test_the_deploy_command_grows_the_disk(self):
"""Le disque demandé à deploy_qemu.py doit inclure les outils : c'est
la seule valeur qui compte, celle du qcow2 réellement créé."""
spec = {
"ssh_key": "",
"desktop": "gnome",
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
"vm_tools": self.all,
[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
"install": {
"branch": "develop",
"prod": False,
"cmd": "make install_os && make install_odoo_18",
"label": "x",
"monitor": True,
},
}
vm = {
"distro": "ubuntu",
"version": "24.04",
"arch": "amd64",
"name": "v",
"ram": 3072,
"vcpus": 4,
"disk": "20G",
"desktop": "gnome",
}
parts = self.todo._qemu_deploy_parts_for(vm, spec, dry_run=True)
size = parts[parts.index("--disk-size") + 1]
expected = (
20
+ TODO.ERPLIBRE_EXTRA_DISK_GB
+ TODO.QEMU_DESKTOP_EXTRA_DISK_GB
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
+ sum(s["disk_gb"] for s in TODO._QEMU_VM_TOOLS.values())
[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
)
self.assertEqual(f"{expected}G", size)
class TestToolRemoteCommand(unittest.TestCase):
def setUp(self):
self.todo = TODO.__new__(TODO)
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
self.all = tuple(TODO._QEMU_VM_TOOLS)
[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
def _sh_ok(self, script):
"""Le shell accepte-t-il ce script ? « bash -n » ne l'exécute pas."""
return subprocess.run(
["bash", "-n"], input=script, text=True, capture_output=True
)
def test_every_combination_is_valid_shell(self):
combos = [
(),
("pycharm",),
("android",),
("gnome_ext",),
self.all,
]
for tools in combos:
script = self.todo._qemu_erplibre_remote_cmd(
"develop", None, False, "gnome", "mise", "deb", tools
)
res = self._sh_ok(script)
self.assertEqual(0, res.returncode, f"{tools} : {res.stderr}")
def test_tools_come_before_the_clone_and_the_make(self):
"""L'ordre est ce qui fait marcher la configuration du projet : PyCharm
écrit le .idea du dépôt en l'ouvrant une fois, et c'est l'installation
qui, ENSUITE, y lance pycharm_configuration.py."""
script = self.todo._qemu_erplibre_remote_cmd(
"develop", None, False, "gnome", "", "deb", ("pycharm",)
)
self.assertLess(script.index("PyCharm"), script.index("git clone"))
self.assertLess(
script.index("PyCharm"), script.index("make install_os")
)
def test_the_install_owns_the_project_configuration(self):
"""update_env_version.pycharm_update() lance déjà le script, et sait se
taire sans .idea. Doubler l'appel n'écrivait qu'une erreur dans le
journal d'une VM neuve."""
script = self.todo._qemu_erplibre_remote_cmd(
"develop", None, False, "gnome", "", "deb", ("pycharm",)
)
self.assertNotIn("pycharm_configuration", script)
def test_a_failing_tool_never_masks_a_failing_install(self):
"""Le code de sortie doit rester celui de l'installation : c'est lui que
lit le tableau de bord pour dire ✅ ou ❌."""
script = (
"set -e\n"
"curl() { return 7; }; sudo() { return 7; }\n"
+ self.todo._qemu_tools_remote_cmd(("pycharm", "android"), False)
+ "\nexit 3\n" # l'installation qui suit, en échec
)
res = subprocess.run(
["bash", "-c", script], capture_output=True, text=True
)
self.assertEqual(3, res.returncode, res.stdout + res.stderr)
def test_a_failing_tool_still_returns_zero(self):
"""Le bloc d'outils est lui-même gardé : PyCharm indisponible ne doit
pas transformer une installation réussie en échec."""
script = "set -e\n" + self.todo._qemu_tools_remote_cmd(self.all, False)
# Tout ce qui pourrait réussir est neutralisé : ni réseau, ni sudo.
stub = (
"curl() { return 7; }; sudo() { return 7; }; tar() { return 7; }; "
"export -f curl sudo tar 2>/dev/null || true\n"
)
res = subprocess.run(
["bash", "-c", stub + script], capture_output=True, text=True
)
self.assertEqual(0, res.returncode, res.stderr)
self.assertIn("PyCharm", res.stdout)
class TestToolDiscoverability(unittest.TestCase):
"""Ce qui est installé doit pouvoir être TROUVÉ. Vécu : Android Studio
posé dans /opt, lanceur nommé « studio », et l'utilisateur conclut à un
échec parce que « android-studio » ne répond pas."""
def setUp(self):
self.todo = TODO.__new__(TODO)
def test_android_studio_answers_to_both_names(self):
cmd = self.todo._qemu_android_studio_remote_cmd()
self.assertIn("/usr/local/bin/studio;", cmd)
self.assertIn("/usr/local/bin/android-studio;", cmd)
def test_the_sdk_is_shared_with_the_desktop_session(self):
"""install-android.sh écrit ses exports dans ~/.bashrc, que GNOME ne
lit pas : sans environment.d, Android Studio lancé depuis le menu
proposerait de télécharger un SECOND SDK."""
cmd = self.todo._qemu_android_studio_remote_cmd()
self.assertIn(".config/environment.d", cmd)
self.assertIn("ANDROID_HOME=", cmd)
# Le même emplacement que celui où la compilation mobile l'installe.
self.assertIn("/android", cmd)
self.assertIn("ANDROID_HOME", self.todo._qemu_mobile_remote_cmd())
[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
def test_the_log_says_where_it_landed(self):
pycharm = self.todo._qemu_pycharm_remote_cmd()
android = self.todo._qemu_android_studio_remote_cmd()
self.assertIn("/opt/pycharm", pycharm)
self.assertIn("/opt/android-studio", android)
def test_pycharm_says_what_creates_the_project(self):
"""Le .idea n'existe qu'après une première ouverture de PyCharm : le
journal le dit, plutôt que de laisser croire à un échec."""
cmd = self.todo._qemu_pycharm_remote_cmd()
self.assertIn(".idea", cmd)
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
class TestMobileBuild(unittest.TestCase):
"""Compilation ERPLibre mobile : la seule étape qui peut faire échouer la
VM, et la seule qui n'exige pas de bureau."""
def setUp(self):
self.todo = TODO.__new__(TODO)
self.all = tuple(TODO._QEMU_VM_TOOLS)
def test_it_runs_on_a_server_vm(self):
[ADD] todo qemu: add an Android emulator, and fix what the real run exposed Running it on a VM was the only way to find these. install_os never installed python3-venv, so .venv.erplibre was born crippled — bin/python but no pip, no activate — and everything downstream failed on "No module named git"; one line of dependency fixes it. Capacitor 8 needs a JDK 21 where the mobile repository's installer puts 17, and Gradle must RUN on it. That installer is not idempotent either, so it is replayed only when something is missing. The new emulator option creates an AVD from the SDK's own device list — the newest plain Pixel, smallest screen — with software rendering written into its config so ssh -X does not open a black screen, and adds the user to the kvm group, without which it refuses to start. Checked on a VM: boot completed in 10 s, adb sees emulator-5554, Android 16 x86_64, no KVM refusal. Vitest: 1938 tests pass. The APK still fails, upstream: sentencepiece builds protoc for the target then runs it on the host. --- FR --- Seule l'exécution sur une VM pouvait trouver ceci. install_os n'installait pas python3-venv, si bien que .venv.erplibre naissait infirme — bin/python mais ni pip ni activate — et tout ce qui en dépend tombait sur « No module named git » ; une ligne de dépendance suffit. Capacitor 8 réclame un JDK 21 là où l'installateur du dépôt mobile pose un 17, et Gradle doit TOURNER dessus. Cet installateur n'est pas idempotent non plus : il n'est rejoué que s'il manque quelque chose. La nouvelle option crée un AVD depuis la liste de profils du SDK — le Pixel simple le plus récent, plus petit écran —, écrit le rendu logiciel dans sa configuration pour qu'ssh -X n'ouvre pas un écran noir, et ajoute l'utilisateur au groupe kvm, sans quoi il refuse de démarrer. Vérifié sur une VM : boot en 10 s, adb voit emulator-5554, Android 16 x86_64, aucun refus de KVM. Vitest : 1938 tests passent. L'APK échoue encore, en amont : sentencepiece bâtit protoc pour la cible puis l'exécute sur l'hôte. Assisted-by: Claude Opus 5
2026-08-18 02:17:08 -04:00
"""Elle compile, elle n'affiche rien : un bureau serait du gaspillage.
L'émulateur non plus n'en a pas besoin — il s'affiche par ssh -X."""
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
got = self.todo._qemu_tools_for(self.all, "amd64", "", "ubuntu")
[ADD] todo qemu: add an Android emulator, and fix what the real run exposed Running it on a VM was the only way to find these. install_os never installed python3-venv, so .venv.erplibre was born crippled — bin/python but no pip, no activate — and everything downstream failed on "No module named git"; one line of dependency fixes it. Capacitor 8 needs a JDK 21 where the mobile repository's installer puts 17, and Gradle must RUN on it. That installer is not idempotent either, so it is replayed only when something is missing. The new emulator option creates an AVD from the SDK's own device list — the newest plain Pixel, smallest screen — with software rendering written into its config so ssh -X does not open a black screen, and adds the user to the kvm group, without which it refuses to start. Checked on a VM: boot completed in 10 s, adb sees emulator-5554, Android 16 x86_64, no KVM refusal. Vitest: 1938 tests pass. The APK still fails, upstream: sentencepiece builds protoc for the target then runs it on the host. --- FR --- Seule l'exécution sur une VM pouvait trouver ceci. install_os n'installait pas python3-venv, si bien que .venv.erplibre naissait infirme — bin/python mais ni pip ni activate — et tout ce qui en dépend tombait sur « No module named git » ; une ligne de dépendance suffit. Capacitor 8 réclame un JDK 21 là où l'installateur du dépôt mobile pose un 17, et Gradle doit TOURNER dessus. Cet installateur n'est pas idempotent non plus : il n'est rejoué que s'il manque quelque chose. La nouvelle option crée un AVD depuis la liste de profils du SDK — le Pixel simple le plus récent, plus petit écran —, écrit le rendu logiciel dans sa configuration pour qu'ssh -X n'ouvre pas un écran noir, et ajoute l'utilisateur au groupe kvm, sans quoi il refuse de démarrer. Vérifié sur une VM : boot en 10 s, adb voit emulator-5554, Android 16 x86_64, aucun refus de KVM. Vitest : 1938 tests passent. L'APK échoue encore, en amont : sentencepiece bâtit protoc pour la cible puis l'exécute sur l'hôte. Assisted-by: Claude Opus 5
2026-08-18 02:17:08 -04:00
self.assertEqual(["mobile", "avd"], got)
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
def test_it_is_bounded_to_apt(self):
"""install-android.sh du dépôt mobile commence par « sudo apt install
openjdk-17-jdk » : ailleurs il s'arrête là."""
for distro in ("fedora", "rocky", "opensuse", "arch"):
self.assertNotIn(
"mobile",
self.todo._qemu_tools_for(self.all, "amd64", "gnome", distro),
distro,
)
self.assertIn(
"mobile",
self.todo._qemu_tools_for(self.all, "amd64", "gnome", "debian"),
)
def test_it_coexists_with_android_studio(self):
"""Combinaison croisée : la VM graphique reçoit les deux, et un seul
SDK — celui de $HOME/android, que ANDROID_HOME désigne."""
got = self.todo._qemu_tools_for(self.all, "amd64", "gnome", "ubuntu")
self.assertIn("android", got)
self.assertIn("mobile", got)
self.assertIn("ANDROID_HOME", self.todo._qemu_mobile_remote_cmd())
def test_it_runs_after_the_install_not_before(self):
"""Elle a besoin du dépôt, du venv qui synchronise le manifeste, et de
node que « make install_os » installe."""
script = self.todo._qemu_erplibre_remote_cmd(
"develop", None, False, "", "", "deb", ("mobile",)
)
self.assertLess(
script.index("make install_os"),
script.index("erplibre-mobile-build.log"),
)
[FIX] script todo: ne plus laisser PyCharm manger la compilation mobile Sur erplibre-ubuntu-2604-gnome, l'APK s'est fait tuer par le noyau. La cause est ici : « $! » désigne xvfb-run, un script, et le tuer n'atteint ni PyCharm ni Xvfb — l'IDE tournait encore 45 minutes après son étape, avec 1,9 Go, quand Gradle a demandé ses 6,8 Go sur 12. C'est le GROUPE qu'on tue maintenant, et plus rien ne survit : mesuré, 2 Go rendus. Le .idea n'était jamais écrit non plus : 122 684 des 123 021 fichiers d'assets du dépôt mobile épuisaient les 65 536 watches inotify. Relevées à 524288, le projet se crée. Restent 4 Go de swap avant de compiler, et un diagnostic qui nomme la mémoire — avec le compte de l'oom-killer — puis la limite ZIP de 65 535 entrées, sur laquelle la compilation bute désormais, en amont. --- EN --- On erplibre-ubuntu-2604-gnome the APK was killed by the kernel. The cause is here: "$!" is xvfb-run, a script, and killing it reaches neither PyCharm nor Xvfb — the IDE was still running 45 minutes after its step, holding 1.9 GB, when Gradle asked for its 6.8 GB out of 12. The GROUP is killed now, and nothing survives it: 2 GB given back, measured. The .idea was never written either: 122,684 of the mobile repo's 123,021 asset files exhausted the 65,536 inotify watches. Raised to 524288, the project gets created. Also 4 GB of swap before building, and a diagnostic naming memory — with the oom-killer count — then the 65,535-entry ZIP limit the build now hits, upstream of us. Assisted-by: Claude Opus 5
2026-08-19 05:38:01 -04:00
# Banc d'essai des étapes mobiles : « mstep » est remplacé par une fonction
# qui réussit tout sauf l'étape nommée, et « sudo » par un no-op. Le contrat
# se MESURE alors au code de sortie, au lieu de se déduire de la présence
# ou de l'absence d'un « || » dans le texte — un « || echo » légitime, celui
# qui ajoute la ligne du fichier d'échange à /etc/fstab, faisait tomber
# l'ancienne version de ce test sans que rien ne soit cassé.
HARNESS = (
'mstep() { echo "-> $1"; case "$1" in *%s*) return 1;; esac; '
"return 0; }\n"
"sudo() { return 0; }\n"
)
def _run_steps(self, fail_on="RIEN", apk=False):
import os
import tempfile
with tempfile.TemporaryDirectory() as tmp:
el = pathlib.Path(tmp) / "el"
apk_dir = el / "mobile/erplibre_home_mobile/android/app/build"
(apk_dir / "outputs/apk/debug").mkdir(parents=True)
if apk:
(apk_dir / "outputs/apk/debug/app-debug.apk").write_text("x")
steps = self.todo._qemu_mobile_build_steps(str(el))
return subprocess.run(
["bash", "-c", (self.HARNESS % fail_on) + steps],
capture_output=True,
text=True,
env=dict(os.environ, HOME=tmp),
timeout=60,
)
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
def test_a_failed_build_fails_the_vm(self):
"""Contrat explicite : « pour que ce soit bon », l'app doit compiler.
[FIX] script todo: ne plus laisser PyCharm manger la compilation mobile Sur erplibre-ubuntu-2604-gnome, l'APK s'est fait tuer par le noyau. La cause est ici : « $! » désigne xvfb-run, un script, et le tuer n'atteint ni PyCharm ni Xvfb — l'IDE tournait encore 45 minutes après son étape, avec 1,9 Go, quand Gradle a demandé ses 6,8 Go sur 12. C'est le GROUPE qu'on tue maintenant, et plus rien ne survit : mesuré, 2 Go rendus. Le .idea n'était jamais écrit non plus : 122 684 des 123 021 fichiers d'assets du dépôt mobile épuisaient les 65 536 watches inotify. Relevées à 524288, le projet se crée. Restent 4 Go de swap avant de compiler, et un diagnostic qui nomme la mémoire — avec le compte de l'oom-killer — puis la limite ZIP de 65 535 entrées, sur laquelle la compilation bute désormais, en amont. --- EN --- On erplibre-ubuntu-2604-gnome the APK was killed by the kernel. The cause is here: "$!" is xvfb-run, a script, and killing it reaches neither PyCharm nor Xvfb — the IDE was still running 45 minutes after its step, holding 1.9 GB, when Gradle asked for its 6.8 GB out of 12. The GROUP is killed now, and nothing survives it: 2 GB given back, measured. The .idea was never written either: 122,684 of the mobile repo's 123,021 asset files exhausted the 65,536 inotify watches. Raised to 524288, the project gets created. Also 4 GB of swap before building, and a diagnostic naming memory — with the oom-killer count — then the 65,535-entry ZIP limit the build now hits, upstream of us. Assisted-by: Claude Opus 5
2026-08-19 05:38:01 -04:00
Une étape en échec doit donc remonter un code non nul."""
res = self._run_steps(fail_on="gradle")
self.assertNotEqual(0, res.returncode, res.stdout[-400:])
def test_a_missing_apk_fails_even_when_gradle_returns_zero(self):
"""L'APK est la preuve, pas le code de sortie de Gradle : une tâche peut
rendre 0 sans rien produire."""
res = self._run_steps(apk=False)
self.assertNotEqual(0, res.returncode)
self.assertIn("APK", res.stdout)
def test_a_complete_build_succeeds(self):
"""L'autre sens du contrat : sans lui, un test qui échoue toujours
passerait pour un test qui vérifie quelque chose."""
res = self._run_steps(apk=True)
self.assertEqual(0, res.returncode, res.stdout[-400:])
def test_the_swap_step_alone_never_fails_the_chain(self):
"""Une image btrfs refuse un fichier d'échange ordinaire, et une
compilation qui tient en mémoire n'en a pas besoin."""
res = self._run_steps(apk=True)
self.assertEqual(0, res.returncode)
self.assertNotIn("|| true", self.todo._qemu_mobile_build_steps("/x"))
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
def test_the_build_covers_apk_and_tests(self):
cmd = self.todo._qemu_mobile_remote_cmd()
for step in (
"update_manifest_local_mobile.sh",
"./install-android.sh",
"npm ci",
"npm run build",
"npx cap sync android",
"./gradlew --no-daemon assembleDebug",
"npm test",
):
self.assertIn(step, cmd, step)
def test_the_platform_comes_from_the_project(self):
"""L'installateur amont pose android-34, variables.gradle demande
compileSdk 36 : on lit le chiffre plutôt que de le figer."""
cmd = self.todo._qemu_mobile_remote_cmd()
self.assertIn("android/variables.gradle", cmd)
self.assertIn("platforms;android-$v", cmd)
self.assertNotIn("platforms;android-36", cmd)
def test_the_apk_is_the_proof(self):
"""Une tâche Gradle peut rendre 0 sans rien produire."""
cmd = self.todo._qemu_mobile_remote_cmd()
self.assertIn("outputs/apk/debug/*.apk", cmd)
[FIX] todo qemu: find the APK where AGP writes it, and install it as it is The app runs in the emulator now, and two of my own checks were wrong. With an injected ABI, AGP writes to intermediates/apk/debug, not outputs/apk/debug: a SUCCESSFUL build was reported "no APK produced" because only the second path was searched. That same mode marks the APK testOnly, so adb refuses it without -t — INSTALL_FAILED_TEST_ONLY. Both measured on the emulator, where ca.erplibre.home then installed, launched, and ran its SQLite migrations. The manifest also stops tracking sentencepiece at master, which made the build non-reproducible and, since August, unbuildable: master fetches protobuf and compiles protoc for the Android target before running it on the host. v0.2.1 ships its .pb.cc pre-generated. Its own absl subset still lacks flags/flag.cc, so that library remains to be sorted out upstream. --- FR --- L'application tourne dans l'émulateur, et deux de mes propres contrôles étaient faux. Avec une ABI injectée, AGP écrit dans intermediates/apk/debug et non dans outputs/apk/debug : une compilation RÉUSSIE était rapportée « aucun APK produit » parce que je ne regardais que le second chemin. Ce même mode marque l'APK testOnly, et adb le refuse sans -t — INSTALL_FAILED_TEST_ONLY. Les deux mesurés sur l'émulateur, où ca.erplibre.home s'est ensuite installé, lancé, et a joué ses migrations SQLite. Le manifeste cesse aussi de suivre sentencepiece à master, ce qui rendait la compilation non reproductible et, depuis août, impossible : master récupère protobuf et compile protoc pour la cible Android avant de l'exécuter sur l'hôte. La v0.2.1 livre ses .pb.cc pré-générés. Son propre sous-ensemble absl manque encore flags/flag.cc : cette bibliothèque reste à régler en amont. Assisted-by: Claude Opus 5
2026-08-18 02:53:17 -04:00
def test_both_apk_locations_are_searched(self):
"""Avec une ABI injectée, AGP écrit dans intermediates et non dans
outputs : mesuré, une compilation RÉUSSIE était rapportée « aucun APK
produit » parce qu'un seul des deux chemins était regardé."""
cmd = self.todo._qemu_mobile_remote_cmd()
self.assertIn("intermediates/apk/debug/*.apk", cmd)
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
def test_no_apk_means_non_zero(self):
"""Éprouvé plutôt que relu : sans APK, le bloc DOIT rendre non nul.
Une ligne d'information placée après le « fi » suffisait à rendre 0 et
à faire repasser la VM au vert."""
cmd = self.todo._qemu_mobile_remote_cmd()
tail = cmd[cmd.index("apk=$(ls") :]
res = subprocess.run(
["bash", "-c", "set -e\n" + tail], capture_output=True, text=True
)
self.assertNotEqual(0, res.returncode, res.stdout)
def test_every_failure_names_a_cause(self):
"""Un journal de dizaines de mégaoctets ne se relit pas : le diagnostic
doit dire pourquoi."""
cmd = self.todo._qemu_mobile_remote_cmd()
[FIX] script todo: ne plus laisser PyCharm manger la compilation mobile Sur erplibre-ubuntu-2604-gnome, l'APK s'est fait tuer par le noyau. La cause est ici : « $! » désigne xvfb-run, un script, et le tuer n'atteint ni PyCharm ni Xvfb — l'IDE tournait encore 45 minutes après son étape, avec 1,9 Go, quand Gradle a demandé ses 6,8 Go sur 12. C'est le GROUPE qu'on tue maintenant, et plus rien ne survit : mesuré, 2 Go rendus. Le .idea n'était jamais écrit non plus : 122 684 des 123 021 fichiers d'assets du dépôt mobile épuisaient les 65 536 watches inotify. Relevées à 524288, le projet se crée. Restent 4 Go de swap avant de compiler, et un diagnostic qui nomme la mémoire — avec le compte de l'oom-killer — puis la limite ZIP de 65 535 entrées, sur laquelle la compilation bute désormais, en amont. --- EN --- On erplibre-ubuntu-2604-gnome the APK was killed by the kernel. The cause is here: "$!" is xvfb-run, a script, and killing it reaches neither PyCharm nor Xvfb — the IDE was still running 45 minutes after its step, holding 1.9 GB, when Gradle asked for its 6.8 GB out of 12. The GROUP is killed now, and nothing survives it: 2 GB given back, measured. The .idea was never written either: 122,684 of the mobile repo's 123,021 asset files exhausted the 65,536 inotify watches. Raised to 524288, the project gets created. Also 4 GB of swap before building, and a diagnostic naming memory — with the oom-killer count — then the 65,535-entry ZIP limit the build now hits, upstream of us. Assisted-by: Claude Opus 5
2026-08-19 05:38:01 -04:00
# Une entrée peut porter un 3e élément : la commande de contexte.
for pattern in (e[0] for e in TODO._QEMU_MOBILE_DIAG):
[ADD] todo qemu: build and test the mobile app, and fail the VM if it breaks A VM was declared ready without anything proving it. The mobile option now adds the repository to the manifest (additive, so it rides along an Odoo 18 install), runs the mobile repository's own install-android.sh — licences accepted included — then npm ci, vite build, cap sync, gradlew assembleDebug and npm test. A failure fails the VM: the exit code reaches the dashboard. Two gaps in that upstream installer had to be filled: unzip and wget, which no cloud image ships, and the SDK platform — it installs android-34 while variables.gradle asks for compileSdk 36, so the number is read from the file rather than frozen. Gradle writes tens of megabytes and hundreds of harmless lines carrying the word error: that output goes to a file of its own, and the log gets the named cause instead. --- FR --- Une VM était déclarée prête sans que rien ne le prouve. L'option mobile ajoute maintenant le dépôt au manifeste (additif, donc il accompagne une installation Odoo 18), lance l'install-android.sh du dépôt mobile lui-même — licences acceptées comprises —, puis npm ci, vite build, cap sync, gradlew assembleDebug et npm test. Un échec fait échouer la VM : le code de sortie remonte au tableau de bord. Deux manques de cet installateur amont ont dû être comblés : unzip et wget, qu'aucune image cloud ne livre, et la plateforme SDK — il pose android-34 quand variables.gradle réclame compileSdk 36, d'où le chiffre lu dans le fichier plutôt que figé. Gradle écrit des dizaines de mégaoctets et des centaines de lignes anodines portant le mot error : cette sortie part dans un fichier à part, et le journal reçoit la cause nommée. Assisted-by: Claude Opus 5
2026-08-18 00:50:08 -04:00
self.assertIn(pattern, cmd, pattern)
self.assertIn('tail -12 "$1"', cmd)
def test_heavy_output_stays_out_of_the_install_log(self):
"""Des centaines de lignes Gradle portant le mot « error » sans être
des pannes rendraient le compteur du tableau de bord inutilisable."""
cmd = self.todo._qemu_mobile_remote_cmd()
self.assertIn('>> "$M" 2>&1', cmd)
[ADD] todo qemu: add an Android emulator, and fix what the real run exposed Running it on a VM was the only way to find these. install_os never installed python3-venv, so .venv.erplibre was born crippled — bin/python but no pip, no activate — and everything downstream failed on "No module named git"; one line of dependency fixes it. Capacitor 8 needs a JDK 21 where the mobile repository's installer puts 17, and Gradle must RUN on it. That installer is not idempotent either, so it is replayed only when something is missing. The new emulator option creates an AVD from the SDK's own device list — the newest plain Pixel, smallest screen — with software rendering written into its config so ssh -X does not open a black screen, and adds the user to the kvm group, without which it refuses to start. Checked on a VM: boot completed in 10 s, adb sees emulator-5554, Android 16 x86_64, no KVM refusal. Vitest: 1938 tests pass. The APK still fails, upstream: sentencepiece builds protoc for the target then runs it on the host. --- FR --- Seule l'exécution sur une VM pouvait trouver ceci. install_os n'installait pas python3-venv, si bien que .venv.erplibre naissait infirme — bin/python mais ni pip ni activate — et tout ce qui en dépend tombait sur « No module named git » ; une ligne de dépendance suffit. Capacitor 8 réclame un JDK 21 là où l'installateur du dépôt mobile pose un 17, et Gradle doit TOURNER dessus. Cet installateur n'est pas idempotent non plus : il n'est rejoué que s'il manque quelque chose. La nouvelle option crée un AVD depuis la liste de profils du SDK — le Pixel simple le plus récent, plus petit écran —, écrit le rendu logiciel dans sa configuration pour qu'ssh -X n'ouvre pas un écran noir, et ajoute l'utilisateur au groupe kvm, sans quoi il refuse de démarrer. Vérifié sur une VM : boot en 10 s, adb voit emulator-5554, Android 16 x86_64, aucun refus de KVM. Vitest : 1938 tests passent. L'APK échoue encore, en amont : sentencepiece bâtit protoc pour la cible puis l'exécute sur l'hôte. Assisted-by: Claude Opus 5
2026-08-18 02:17:08 -04:00
class TestAndroidEmulator(unittest.TestCase):
"""Émulateur Android : visible depuis le poste par « ssh -X »."""
def setUp(self):
self.todo = TODO.__new__(TODO)
self.cmd = self.todo._qemu_avd_remote_cmd()
def test_no_desktop_needed_in_the_vm(self):
"""Il s'affiche sur l'écran de qui s'y connecte, pas dans la VM."""
self.assertFalse(TODO._QEMU_VM_TOOLS["avd"]["needs_desktop"])
self.assertIn(
"avd", self.todo._qemu_tools_for(("avd",), "amd64", "", "ubuntu")
)
2026-08-18 03:31:53 -04:00
def test_the_screen_is_small_enough_to_travel(self):
"""Le profil Pixel donne 1080x2400 : 2,6 Mpixels par image à pousser
dans SSH, et « ça se lance mais c'est trop lent ». Mesuré après
réduction : 540x1140 confirmé par « wm size », et la capture pleine
page tombe de 220 Ko à 49 Ko."""
for key in (
"hw.lcd.width=540",
"hw.lcd.height=1140",
"hw.lcd.density=240",
):
self.assertIn(key, self.cmd, key)
def test_the_printed_command_compresses_the_display(self):
"""« -XC » plutôt que « -X » sur un écran distant."""
self.assertIn("ssh -XC erplibre@$ip", self.cmd)
self.assertNotIn("ssh -X erplibre@$ip", self.cmd.replace("-XC", ""))
[ADD] todo qemu: add an Android emulator, and fix what the real run exposed Running it on a VM was the only way to find these. install_os never installed python3-venv, so .venv.erplibre was born crippled — bin/python but no pip, no activate — and everything downstream failed on "No module named git"; one line of dependency fixes it. Capacitor 8 needs a JDK 21 where the mobile repository's installer puts 17, and Gradle must RUN on it. That installer is not idempotent either, so it is replayed only when something is missing. The new emulator option creates an AVD from the SDK's own device list — the newest plain Pixel, smallest screen — with software rendering written into its config so ssh -X does not open a black screen, and adds the user to the kvm group, without which it refuses to start. Checked on a VM: boot completed in 10 s, adb sees emulator-5554, Android 16 x86_64, no KVM refusal. Vitest: 1938 tests pass. The APK still fails, upstream: sentencepiece builds protoc for the target then runs it on the host. --- FR --- Seule l'exécution sur une VM pouvait trouver ceci. install_os n'installait pas python3-venv, si bien que .venv.erplibre naissait infirme — bin/python mais ni pip ni activate — et tout ce qui en dépend tombait sur « No module named git » ; une ligne de dépendance suffit. Capacitor 8 réclame un JDK 21 là où l'installateur du dépôt mobile pose un 17, et Gradle doit TOURNER dessus. Cet installateur n'est pas idempotent non plus : il n'est rejoué que s'il manque quelque chose. La nouvelle option crée un AVD depuis la liste de profils du SDK — le Pixel simple le plus récent, plus petit écran —, écrit le rendu logiciel dans sa configuration pour qu'ssh -X n'ouvre pas un écran noir, et ajoute l'utilisateur au groupe kvm, sans quoi il refuse de démarrer. Vérifié sur une VM : boot en 10 s, adb voit emulator-5554, Android 16 x86_64, aucun refus de KVM. Vitest : 1938 tests passent. L'APK échoue encore, en amont : sentencepiece bâtit protoc pour la cible puis l'exécute sur l'hôte. Assisted-by: Claude Opus 5
2026-08-18 02:17:08 -04:00
def test_software_rendering_is_written_into_the_avd(self):
"""Par « ssh -X » il n'y a pas de GLX direct : en « auto »,
l'émulateur s'ouvre sur un écran noir. Le réglage va dans config.ini
pour qu'« emulator -avd erplibre » suffise."""
self.assertIn("hw.gpu.mode=swangle", self.cmd)
[ADD] todo qemu: add an Android emulator, and fix what the real run exposed Running it on a VM was the only way to find these. install_os never installed python3-venv, so .venv.erplibre was born crippled — bin/python but no pip, no activate — and everything downstream failed on "No module named git"; one line of dependency fixes it. Capacitor 8 needs a JDK 21 where the mobile repository's installer puts 17, and Gradle must RUN on it. That installer is not idempotent either, so it is replayed only when something is missing. The new emulator option creates an AVD from the SDK's own device list — the newest plain Pixel, smallest screen — with software rendering written into its config so ssh -X does not open a black screen, and adds the user to the kvm group, without which it refuses to start. Checked on a VM: boot completed in 10 s, adb sees emulator-5554, Android 16 x86_64, no KVM refusal. Vitest: 1938 tests pass. The APK still fails, upstream: sentencepiece builds protoc for the target then runs it on the host. --- FR --- Seule l'exécution sur une VM pouvait trouver ceci. install_os n'installait pas python3-venv, si bien que .venv.erplibre naissait infirme — bin/python mais ni pip ni activate — et tout ce qui en dépend tombait sur « No module named git » ; une ligne de dépendance suffit. Capacitor 8 réclame un JDK 21 là où l'installateur du dépôt mobile pose un 17, et Gradle doit TOURNER dessus. Cet installateur n'est pas idempotent non plus : il n'est rejoué que s'il manque quelque chose. La nouvelle option crée un AVD depuis la liste de profils du SDK — le Pixel simple le plus récent, plus petit écran —, écrit le rendu logiciel dans sa configuration pour qu'ssh -X n'ouvre pas un écran noir, et ajoute l'utilisateur au groupe kvm, sans quoi il refuse de démarrer. Vérifié sur une VM : boot en 10 s, adb voit emulator-5554, Android 16 x86_64, aucun refus de KVM. Vitest : 1938 tests passent. L'APK échoue encore, en amont : sentencepiece bâtit protoc pour la cible puis l'exécute sur l'hôte. Assisted-by: Claude Opus 5
2026-08-18 02:17:08 -04:00
self.assertIn("config.ini", self.cmd)
# « swiftshader_indirect » n'existe plus : l'émulateur 37.1 le refuse,
# affiche deux erreurs et retombe sur swangle de lui-même. Mesuré.
self.assertNotIn("swiftshader_indirect", self.cmd)
[ADD] todo qemu: add an Android emulator, and fix what the real run exposed Running it on a VM was the only way to find these. install_os never installed python3-venv, so .venv.erplibre was born crippled — bin/python but no pip, no activate — and everything downstream failed on "No module named git"; one line of dependency fixes it. Capacitor 8 needs a JDK 21 where the mobile repository's installer puts 17, and Gradle must RUN on it. That installer is not idempotent either, so it is replayed only when something is missing. The new emulator option creates an AVD from the SDK's own device list — the newest plain Pixel, smallest screen — with software rendering written into its config so ssh -X does not open a black screen, and adds the user to the kvm group, without which it refuses to start. Checked on a VM: boot completed in 10 s, adb sees emulator-5554, Android 16 x86_64, no KVM refusal. Vitest: 1938 tests pass. The APK still fails, upstream: sentencepiece builds protoc for the target then runs it on the host. --- FR --- Seule l'exécution sur une VM pouvait trouver ceci. install_os n'installait pas python3-venv, si bien que .venv.erplibre naissait infirme — bin/python mais ni pip ni activate — et tout ce qui en dépend tombait sur « No module named git » ; une ligne de dépendance suffit. Capacitor 8 réclame un JDK 21 là où l'installateur du dépôt mobile pose un 17, et Gradle doit TOURNER dessus. Cet installateur n'est pas idempotent non plus : il n'est rejoué que s'il manque quelque chose. La nouvelle option crée un AVD depuis la liste de profils du SDK — le Pixel simple le plus récent, plus petit écran —, écrit le rendu logiciel dans sa configuration pour qu'ssh -X n'ouvre pas un écran noir, et ajoute l'utilisateur au groupe kvm, sans quoi il refuse de démarrer. Vérifié sur une VM : boot en 10 s, adb voit emulator-5554, Android 16 x86_64, aucun refus de KVM. Vitest : 1938 tests passent. L'APK échoue encore, en amont : sentencepiece bâtit protoc pour la cible puis l'exécute sur l'hôte. Assisted-by: Claude Opus 5
2026-08-18 02:17:08 -04:00
def test_xauth_is_installed(self):
"""Sans xauth dans la VM, « ssh -X » n'ouvre aucun affichage — et le
paquet manque des images cloud."""
self.assertIn("xauth", self.cmd)
def test_it_says_when_kvm_is_missing(self):
"""Un émulateur x86 sans KVM refuse de démarrer : le dire là où c'est
réparable, sur l'hôte, plutôt qu'au premier lancement."""
self.assertIn("/dev/kvm", self.cmd)
def test_the_pixel_is_chosen_at_runtime(self):
"""« le plus récent, le plus petit écran » se demande au SDK : figer un
modèle le rendrait faux à la prochaine génération."""
self.assertIn("avdmanager list device", self.cmd)
self.assertIn("pixel_", self.cmd)
self.assertIn("pro|xl|fold|tablet", self.cmd)
self.assertIn("sort -t_ -k2 -n", self.cmd)
def test_the_system_image_falls_back(self):
"""Google ne publie pas d'image pour toutes les API : on descend."""
self.assertIn("for a in $v 36 35 34", self.cmd)
def test_it_prints_the_command_to_open_it(self):
"""Un émulateur dont on ignore comment l'ouvrir ne sert à personne."""
2026-08-18 03:31:53 -04:00
self.assertIn("ssh -XC erplibre@$ip", self.cmd)
[ADD] todo qemu: add an Android emulator, and fix what the real run exposed Running it on a VM was the only way to find these. install_os never installed python3-venv, so .venv.erplibre was born crippled — bin/python but no pip, no activate — and everything downstream failed on "No module named git"; one line of dependency fixes it. Capacitor 8 needs a JDK 21 where the mobile repository's installer puts 17, and Gradle must RUN on it. That installer is not idempotent either, so it is replayed only when something is missing. The new emulator option creates an AVD from the SDK's own device list — the newest plain Pixel, smallest screen — with software rendering written into its config so ssh -X does not open a black screen, and adds the user to the kvm group, without which it refuses to start. Checked on a VM: boot completed in 10 s, adb sees emulator-5554, Android 16 x86_64, no KVM refusal. Vitest: 1938 tests pass. The APK still fails, upstream: sentencepiece builds protoc for the target then runs it on the host. --- FR --- Seule l'exécution sur une VM pouvait trouver ceci. install_os n'installait pas python3-venv, si bien que .venv.erplibre naissait infirme — bin/python mais ni pip ni activate — et tout ce qui en dépend tombait sur « No module named git » ; une ligne de dépendance suffit. Capacitor 8 réclame un JDK 21 là où l'installateur du dépôt mobile pose un 17, et Gradle doit TOURNER dessus. Cet installateur n'est pas idempotent non plus : il n'est rejoué que s'il manque quelque chose. La nouvelle option crée un AVD depuis la liste de profils du SDK — le Pixel simple le plus récent, plus petit écran —, écrit le rendu logiciel dans sa configuration pour qu'ssh -X n'ouvre pas un écran noir, et ajoute l'utilisateur au groupe kvm, sans quoi il refuse de démarrer. Vérifié sur une VM : boot en 10 s, adb voit emulator-5554, Android 16 x86_64, aucun refus de KVM. Vitest : 1938 tests passent. L'APK échoue encore, en amont : sentencepiece bâtit protoc pour la cible puis l'exécute sur l'hôte. Assisted-by: Claude Opus 5
2026-08-18 02:17:08 -04:00
self.assertIn("adb install -r", self.cmd)
[FIX] todo qemu: the printed emulator command could not run as printed Reported from a workstation: "emulator: command not found". The line the emulator step printed relied on PATH, and "ssh host 'command'" reads neither ~/.profile nor ~/.bashrc — Ubuntu even opens the latter with a return for non-interactive shells. So what install-android.sh writes there never applies to those commands. Both printed lines now carry absolute paths. Behind it, a second one: the emulator ships TWO qemu binaries and only the headless one does without PulseAudio. The windowed one — the ssh -X case — links libpulse.so.0, absent from cloud images, and stops on "cannot open shared object file" even with -no-audio. Measured: it is the only missing library, the Qt dependencies travel in the bundle. Checked after the fix: the windowed binary starts and reports its version. --- FR --- Remonté depuis un poste : « emulator: command not found ». La ligne affichée par l'étape émulateur comptait sur le PATH, or « ssh hôte 'commande' » ne lit ni ~/.profile ni ~/.bashrc — Ubuntu ouvre même le second par un return pour les shells non interactifs. Ce que install-android.sh y écrit ne s'applique donc jamais à ces commandes. Les deux lignes affichées portent maintenant des chemins absolus. Derrière, une seconde : l'émulateur livre DEUX binaires qemu et seul le headless se passe de PulseAudio. Celui qui ouvre une fenêtre — le cas du ssh -X — lie libpulse.so.0, absente des images cloud, et s'arrête sur « cannot open shared object file » même avec -no-audio. Mesuré : c'est la seule bibliothèque qui manque, les dépendances Qt voyagent dans le bundle. Vérifié après correction : le binaire fenêtré démarre et donne sa version. Assisted-by: Claude Opus 5
2026-08-18 02:30:02 -04:00
def test_the_printed_commands_use_absolute_paths(self):
"""« ssh hôte 'commande' » ne lit ni ~/.profile ni ~/.bashrc — Ubuntu y
met même un « return » pour les shells non interactifs. Une commande
affichée qui compte sur le PATH répond « command not found ». Vécu."""
self.assertIn("$HOME/android/emulator/emulator", self.cmd)
self.assertIn("$HOME/android/platform-tools/adb", self.cmd)
self.assertNotIn('"emulator -avd', self.cmd)
self.assertNotIn('"adb install', self.cmd)
def test_the_windowed_emulator_gets_its_audio_library(self):
"""Deux binaires qemu : seul le « headless » se passe de PulseAudio.
Celui qui ouvre une fenêtre lie libpulse.so.0, absente des images
cloud, et échoue même avec « -no-audio »."""
self.assertIn("libpulse0", self.cmd)
[ADD] todo qemu: add an Android emulator, and fix what the real run exposed Running it on a VM was the only way to find these. install_os never installed python3-venv, so .venv.erplibre was born crippled — bin/python but no pip, no activate — and everything downstream failed on "No module named git"; one line of dependency fixes it. Capacitor 8 needs a JDK 21 where the mobile repository's installer puts 17, and Gradle must RUN on it. That installer is not idempotent either, so it is replayed only when something is missing. The new emulator option creates an AVD from the SDK's own device list — the newest plain Pixel, smallest screen — with software rendering written into its config so ssh -X does not open a black screen, and adds the user to the kvm group, without which it refuses to start. Checked on a VM: boot completed in 10 s, adb sees emulator-5554, Android 16 x86_64, no KVM refusal. Vitest: 1938 tests pass. The APK still fails, upstream: sentencepiece builds protoc for the target then runs it on the host. --- FR --- Seule l'exécution sur une VM pouvait trouver ceci. install_os n'installait pas python3-venv, si bien que .venv.erplibre naissait infirme — bin/python mais ni pip ni activate — et tout ce qui en dépend tombait sur « No module named git » ; une ligne de dépendance suffit. Capacitor 8 réclame un JDK 21 là où l'installateur du dépôt mobile pose un 17, et Gradle doit TOURNER dessus. Cet installateur n'est pas idempotent non plus : il n'est rejoué que s'il manque quelque chose. La nouvelle option crée un AVD depuis la liste de profils du SDK — le Pixel simple le plus récent, plus petit écran —, écrit le rendu logiciel dans sa configuration pour qu'ssh -X n'ouvre pas un écran noir, et ajoute l'utilisateur au groupe kvm, sans quoi il refuse de démarrer. Vérifié sur une VM : boot en 10 s, adb voit emulator-5554, Android 16 x86_64, aucun refus de KVM. Vitest : 1938 tests passent. L'APK échoue encore, en amont : sentencepiece bâtit protoc pour la cible puis l'exécute sur l'hôte. Assisted-by: Claude Opus 5
2026-08-18 02:17:08 -04:00
def test_one_prologue_and_one_sdk_for_both_options(self):
"""Deux prologues, et le second tronquerait le journal du premier."""
both = self.todo._qemu_after_remote_cmd(("mobile", "avd"))
self.assertEqual(1, both.count("mstep() {"))
self.assertEqual(1, both.count('M="$HOME/erplibre-mobile-build.log"'))
def test_the_emulator_cannot_mask_a_build_failure(self):
"""ÉPROUVÉ, pas relu. Sans accolades autour de chaque groupe, « && » ne
lie que la première commande du suivant : mesuré sur une VM, un APK
manquant laissait tourner l'émulateur puis rendait 0 — la VM repassait
au vert alors que rien n'avait compilé."""
both = self.todo._qemu_after_remote_cmd(("mobile", "avd"))
# On neutralise les étapes : seul le CHAÎNAGE est en cause ici.
[FIX] script todo: ne plus laisser PyCharm manger la compilation mobile Sur erplibre-ubuntu-2604-gnome, l'APK s'est fait tuer par le noyau. La cause est ici : « $! » désigne xvfb-run, un script, et le tuer n'atteint ni PyCharm ni Xvfb — l'IDE tournait encore 45 minutes après son étape, avec 1,9 Go, quand Gradle a demandé ses 6,8 Go sur 12. C'est le GROUPE qu'on tue maintenant, et plus rien ne survit : mesuré, 2 Go rendus. Le .idea n'était jamais écrit non plus : 122 684 des 123 021 fichiers d'assets du dépôt mobile épuisaient les 65 536 watches inotify. Relevées à 524288, le projet se crée. Restent 4 Go de swap avant de compiler, et un diagnostic qui nomme la mémoire — avec le compte de l'oom-killer — puis la limite ZIP de 65 535 entrées, sur laquelle la compilation bute désormais, en amont. --- EN --- On erplibre-ubuntu-2604-gnome the APK was killed by the kernel. The cause is here: "$!" is xvfb-run, a script, and killing it reaches neither PyCharm nor Xvfb — the IDE was still running 45 minutes after its step, holding 1.9 GB, when Gradle asked for its 6.8 GB out of 12. The GROUP is killed now, and nothing survives it: 2 GB given back, measured. The .idea was never written either: 122,684 of the mobile repo's 123,021 asset files exhausted the 65,536 inotify watches. Raised to 524288, the project gets created. Also 4 GB of swap before building, and a diagnostic naming memory — with the oom-killer count — then the 65,535-entry ZIP limit the build now hits, upstream of us. Assisted-by: Claude Opus 5
2026-08-19 05:38:01 -04:00
#
# « sudo » est neutralisé AUSSI, et ce n'est pas décoratif : le bloc
# ajoute un fichier d'échange de 4 Go et une ligne à /etc/fstab. Sans
# ce bouchon, un test le ferait sur la machine qui l'exécute.
stub = (
'mstep() { echo " -> $1"; return 0; }; mdiag() { :; }; '
"sudo() { return 0; }; "
)
# Ancre robuste : on part du journal mobile et on remonte à l'accolade
# qui ouvre son groupe. Chercher « { mstep » liait ce test à la forme
# de la PREMIÈRE étape, et l'ajout du swap devant l'a cassé.
marker = both.index("erplibre-mobile-build.log")
tail = both[both.rindex("{ ", 0, marker) :]
[ADD] todo qemu: add an Android emulator, and fix what the real run exposed Running it on a VM was the only way to find these. install_os never installed python3-venv, so .venv.erplibre was born crippled — bin/python but no pip, no activate — and everything downstream failed on "No module named git"; one line of dependency fixes it. Capacitor 8 needs a JDK 21 where the mobile repository's installer puts 17, and Gradle must RUN on it. That installer is not idempotent either, so it is replayed only when something is missing. The new emulator option creates an AVD from the SDK's own device list — the newest plain Pixel, smallest screen — with software rendering written into its config so ssh -X does not open a black screen, and adds the user to the kvm group, without which it refuses to start. Checked on a VM: boot completed in 10 s, adb sees emulator-5554, Android 16 x86_64, no KVM refusal. Vitest: 1938 tests pass. The APK still fails, upstream: sentencepiece builds protoc for the target then runs it on the host. --- FR --- Seule l'exécution sur une VM pouvait trouver ceci. install_os n'installait pas python3-venv, si bien que .venv.erplibre naissait infirme — bin/python mais ni pip ni activate — et tout ce qui en dépend tombait sur « No module named git » ; une ligne de dépendance suffit. Capacitor 8 réclame un JDK 21 là où l'installateur du dépôt mobile pose un 17, et Gradle doit TOURNER dessus. Cet installateur n'est pas idempotent non plus : il n'est rejoué que s'il manque quelque chose. La nouvelle option crée un AVD depuis la liste de profils du SDK — le Pixel simple le plus récent, plus petit écran —, écrit le rendu logiciel dans sa configuration pour qu'ssh -X n'ouvre pas un écran noir, et ajoute l'utilisateur au groupe kvm, sans quoi il refuse de démarrer. Vérifié sur une VM : boot en 10 s, adb voit emulator-5554, Android 16 x86_64, aucun refus de KVM. Vitest : 1938 tests passent. L'APK échoue encore, en amont : sentencepiece bâtit protoc pour la cible puis l'exécute sur l'hôte. Assisted-by: Claude Opus 5
2026-08-18 02:17:08 -04:00
res = subprocess.run(
["bash", "-c", "set -e; " + stub + tail],
capture_output=True,
text=True,
)
self.assertNotEqual(0, res.returncode, res.stdout)
# Et l'émulateur ne doit PAS avoir été touché.
self.assertNotIn("Pixel", res.stdout)
def test_valid_shell_in_every_combination(self):
for tools in (("mobile",), ("avd",), ("mobile", "avd")):
cmd = self.todo._qemu_after_remote_cmd(tools)
res = subprocess.run(
["bash", "-n"], input=cmd, text=True, capture_output=True
)
self.assertEqual(0, res.returncode, f"{tools}: {res.stderr}")
def test_no_diagnostic_pattern_carries_an_apostrophe(self):
"""Ces motifs partent dans un « grep -q '<motif>' » : une apostrophe
fermait la chaîne et rendait tout le bloc invalide. Vécu."""
[FIX] script todo: ne plus laisser PyCharm manger la compilation mobile Sur erplibre-ubuntu-2604-gnome, l'APK s'est fait tuer par le noyau. La cause est ici : « $! » désigne xvfb-run, un script, et le tuer n'atteint ni PyCharm ni Xvfb — l'IDE tournait encore 45 minutes après son étape, avec 1,9 Go, quand Gradle a demandé ses 6,8 Go sur 12. C'est le GROUPE qu'on tue maintenant, et plus rien ne survit : mesuré, 2 Go rendus. Le .idea n'était jamais écrit non plus : 122 684 des 123 021 fichiers d'assets du dépôt mobile épuisaient les 65 536 watches inotify. Relevées à 524288, le projet se crée. Restent 4 Go de swap avant de compiler, et un diagnostic qui nomme la mémoire — avec le compte de l'oom-killer — puis la limite ZIP de 65 535 entrées, sur laquelle la compilation bute désormais, en amont. --- EN --- On erplibre-ubuntu-2604-gnome the APK was killed by the kernel. The cause is here: "$!" is xvfb-run, a script, and killing it reaches neither PyCharm nor Xvfb — the IDE was still running 45 minutes after its step, holding 1.9 GB, when Gradle asked for its 6.8 GB out of 12. The GROUP is killed now, and nothing survives it: 2 GB given back, measured. The .idea was never written either: 122,684 of the mobile repo's 123,021 asset files exhausted the 65,536 inotify watches. Raised to 524288, the project gets created. Also 4 GB of swap before building, and a diagnostic naming memory — with the oom-killer count — then the 65,535-entry ZIP limit the build now hits, upstream of us. Assisted-by: Claude Opus 5
2026-08-19 05:38:01 -04:00
# Une entrée peut porter un 3e élément : la commande de contexte.
for pattern in (e[0] for e in TODO._QEMU_MOBILE_DIAG):
[ADD] todo qemu: add an Android emulator, and fix what the real run exposed Running it on a VM was the only way to find these. install_os never installed python3-venv, so .venv.erplibre was born crippled — bin/python but no pip, no activate — and everything downstream failed on "No module named git"; one line of dependency fixes it. Capacitor 8 needs a JDK 21 where the mobile repository's installer puts 17, and Gradle must RUN on it. That installer is not idempotent either, so it is replayed only when something is missing. The new emulator option creates an AVD from the SDK's own device list — the newest plain Pixel, smallest screen — with software rendering written into its config so ssh -X does not open a black screen, and adds the user to the kvm group, without which it refuses to start. Checked on a VM: boot completed in 10 s, adb sees emulator-5554, Android 16 x86_64, no KVM refusal. Vitest: 1938 tests pass. The APK still fails, upstream: sentencepiece builds protoc for the target then runs it on the host. --- FR --- Seule l'exécution sur une VM pouvait trouver ceci. install_os n'installait pas python3-venv, si bien que .venv.erplibre naissait infirme — bin/python mais ni pip ni activate — et tout ce qui en dépend tombait sur « No module named git » ; une ligne de dépendance suffit. Capacitor 8 réclame un JDK 21 là où l'installateur du dépôt mobile pose un 17, et Gradle doit TOURNER dessus. Cet installateur n'est pas idempotent non plus : il n'est rejoué que s'il manque quelque chose. La nouvelle option crée un AVD depuis la liste de profils du SDK — le Pixel simple le plus récent, plus petit écran —, écrit le rendu logiciel dans sa configuration pour qu'ssh -X n'ouvre pas un écran noir, et ajoute l'utilisateur au groupe kvm, sans quoi il refuse de démarrer. Vérifié sur une VM : boot en 10 s, adb voit emulator-5554, Android 16 x86_64, aucun refus de KVM. Vitest : 1938 tests passent. L'APK échoue encore, en amont : sentencepiece bâtit protoc pour la cible puis l'exécute sur l'hôte. Assisted-by: Claude Opus 5
2026-08-18 02:17:08 -04:00
self.assertNotIn("'", pattern, pattern)
[FIX] todo qemu: open the PyCharm project without a screen, and unlicensed Two measurements, one after the other. The unified PyCharm that code=PCC&latest now serves stops on its licence: the log says NoValidIdeLicense then "Get licenses: request requires authentication", and no project is ever opened — so no .idea, so nothing for the install to configure. The Community line asks for no account and is still patched (2025.2.6.2 on 2026-07-29); it is resolved from the release feed, so no version is frozen here. That build then froze 1.3 s after startup: the trust dialog, invisible under Xvfb and waiting for a click. idea.trust.all.projects unblocks it. Checked on an Ubuntu 26.04 VM: .idea complete in 195 s, and pycharm_configuration.py writes its exclusions into erplibre.iml. --- FR --- Deux mesures, l'une après l'autre. Le PyCharm unifié que sert désormais code=PCC&latest s'arrête sur sa licence : le journal dit NoValidIdeLicense puis « Get licenses: request requires authentication », et aucun projet ne s'ouvre — donc pas de .idea, donc rien à configurer pour l'installation. La ligne Community ne demande aucun compte et reste corrigée (2025.2.6.2 le 2026-07-29) ; elle est résolue depuis le flux des versions, sans qu'aucun numéro ne soit figé ici. Ce build se figeait ensuite 1,3 s après le démarrage : la fenêtre de confiance, invisible sous Xvfb et attendant un clic. idea.trust.all.projects la lève. Vérifié sur une VM Ubuntu 26.04 : .idea complet en 195 s, et pycharm_configuration.py écrit ses exclusions dans erplibre.iml. Assisted-by: Claude Opus 5
2026-08-17 23:22:38 -04:00
class TestPycharmCommunity(unittest.TestCase):
"""PyCharm doit s'ouvrir sans compte : c'est toute la différence entre une
VM utilisable au premier démarrage et une VM qui demande une licence."""
def setUp(self):
self.todo = TODO.__new__(TODO)
self.cmd = self.todo._qemu_pycharm_remote_cmd()
def test_the_community_line_is_what_is_looked_up(self):
"""Mesuré dans une VM : le build unifié s'arrête sur
« NoValidIdeLicense » et n'ouvre jamais le projet."""
self.assertIn("pycharm-community-", self.cmd)
self.assertIn("data.services.jetbrains.com", self.cmd)
def test_no_version_is_frozen_in_the_repository(self):
"""Le flux donne la plus récente : rien à mettre à jour ici quand
JetBrains publie un correctif."""
self.assertNotIn("2025.2.6", self.cmd)
self.assertNotIn("pycharm-community-2", self.cmd)
def test_both_architectures_are_asked_for(self):
self.assertIn("linuxARM64", self.cmd)
self.assertIn("jb=linux", self.cmd)
def test_the_fallback_names_its_cost(self):
"""Le repli sert le build unifié : le dire, plutôt que de le laisser
découvrir au premier lancement."""
self.assertIn("code=PCC&latest", self.cmd)
self.assertIn("JetBrains", self.cmd)
class TestPycharmFirstOpen(unittest.TestCase):
[FIX] script todo: ne plus laisser PyCharm manger la compilation mobile Sur erplibre-ubuntu-2604-gnome, l'APK s'est fait tuer par le noyau. La cause est ici : « $! » désigne xvfb-run, un script, et le tuer n'atteint ni PyCharm ni Xvfb — l'IDE tournait encore 45 minutes après son étape, avec 1,9 Go, quand Gradle a demandé ses 6,8 Go sur 12. C'est le GROUPE qu'on tue maintenant, et plus rien ne survit : mesuré, 2 Go rendus. Le .idea n'était jamais écrit non plus : 122 684 des 123 021 fichiers d'assets du dépôt mobile épuisaient les 65 536 watches inotify. Relevées à 524288, le projet se crée. Restent 4 Go de swap avant de compiler, et un diagnostic qui nomme la mémoire — avec le compte de l'oom-killer — puis la limite ZIP de 65 535 entrées, sur laquelle la compilation bute désormais, en amont. --- EN --- On erplibre-ubuntu-2604-gnome the APK was killed by the kernel. The cause is here: "$!" is xvfb-run, a script, and killing it reaches neither PyCharm nor Xvfb — the IDE was still running 45 minutes after its step, holding 1.9 GB, when Gradle asked for its 6.8 GB out of 12. The GROUP is killed now, and nothing survives it: 2 GB given back, measured. The .idea was never written either: 122,684 of the mobile repo's 123,021 asset files exhausted the 65,536 inotify watches. Raised to 524288, the project gets created. Also 4 GB of swap before building, and a diagnostic naming memory — with the oom-killer count — then the 65,535-entry ZIP limit the build now hits, upstream of us. Assisted-by: Claude Opus 5
2026-08-19 05:38:01 -04:00
"""Ouverture sans écran, pour que le .idea existe avant l'installation.
Deux défauts vécus sur erplibre-ubuntu-2604-gnome, tous deux silencieux :
l'IDE restait vivant 45 minutes après l'étape avec 1,9 Go — « $! » est le
PID de xvfb-run, un script, et le tuer n'atteint ni PyCharm ni Xvfb — puis
la compilation de l'APK qui suivait s'est fait tuer par le noyau. Et le
.idea n'était jamais écrit : 123 000 fichiers d'assets épuisent les watches
inotify, dont la limite valait 65 536.
"""
[FIX] todo qemu: open the PyCharm project without a screen, and unlicensed Two measurements, one after the other. The unified PyCharm that code=PCC&latest now serves stops on its licence: the log says NoValidIdeLicense then "Get licenses: request requires authentication", and no project is ever opened — so no .idea, so nothing for the install to configure. The Community line asks for no account and is still patched (2025.2.6.2 on 2026-07-29); it is resolved from the release feed, so no version is frozen here. That build then froze 1.3 s after startup: the trust dialog, invisible under Xvfb and waiting for a click. idea.trust.all.projects unblocks it. Checked on an Ubuntu 26.04 VM: .idea complete in 195 s, and pycharm_configuration.py writes its exclusions into erplibre.iml. --- FR --- Deux mesures, l'une après l'autre. Le PyCharm unifié que sert désormais code=PCC&latest s'arrête sur sa licence : le journal dit NoValidIdeLicense puis « Get licenses: request requires authentication », et aucun projet ne s'ouvre — donc pas de .idea, donc rien à configurer pour l'installation. La ligne Community ne demande aucun compte et reste corrigée (2025.2.6.2 le 2026-07-29) ; elle est résolue depuis le flux des versions, sans qu'aucun numéro ne soit figé ici. Ce build se figeait ensuite 1,3 s après le démarrage : la fenêtre de confiance, invisible sous Xvfb et attendant un clic. idea.trust.all.projects la lève. Vérifié sur une VM Ubuntu 26.04 : .idea complet en 195 s, et pycharm_configuration.py écrit ses exclusions dans erplibre.iml. Assisted-by: Claude Opus 5
2026-08-17 23:22:38 -04:00
def setUp(self):
self.todo = TODO.__new__(TODO)
self.cmd = self.todo._qemu_pycharm_project_cmd()
def test_it_runs_between_the_clone_and_the_make(self):
script = self.todo._qemu_erplibre_remote_cmd(
"develop", None, False, "gnome", "", "deb", ("pycharm",)
)
self.assertLess(script.index("git clone"), script.index("xvfb-run"))
self.assertLess(
script.index("xvfb-run"), script.index("make install_os")
)
def test_only_when_pycharm_was_asked_for(self):
script = self.todo._qemu_erplibre_remote_cmd(
"develop", None, False, "gnome", "", "deb", ("android",)
)
self.assertNotIn("xvfb-run", script)
def test_the_first_run_dialogs_are_answered_in_advance(self):
"""Sans réponse, la session attend un clic que personne ne donnera.
Celle de la CONFIANCE est la plus coûteuse à rater : mesuré, le journal
s'arrête 1,3 s après le démarrage et le projet ne s'ouvre jamais."""
self.assertIn("idea.trust.all.projects=true", self.cmd)
self.assertIn("jb.consents.confirmation.enabled=false", self.cmd)
self.assertIn("consentOptions", self.cmd)
# Le consentement est écrit REFUSÉ : aucune statistique ne part.
self.assertIn("rsch.send.usage.stat:1.1:0:", self.cmd)
def test_xvfb_package_names_are_per_family(self):
"""« xvfb » n'existe que chez Debian : ailleurs le paquet s'appelle
autrement, et un nom inventé ne s'installerait pas."""
self.assertEqual("xvfb", TODO._QEMU_XVFB_PKG["apt"])
self.assertEqual("xorg-x11-server-Xvfb", TODO._QEMU_XVFB_PKG["dnf"])
self.assertEqual("xorg-server-xvfb", TODO._QEMU_XVFB_PKG["pacman"])
def test_it_gives_up_rather_than_hangs(self):
"""Un IDE qui ne s'ouvre pas ne doit pas retenir l'installation : le
budget est borné et le processus tué."""
self.assertIn("kill -TERM", self.cmd)
self.assertIn("kill -KILL", self.cmd)
self.assertIn(f"seq 1 {TODO._QEMU_PYCHARM_OPEN_TRIES}", self.cmd)
def test_valid_shell(self):
res = subprocess.run(
["bash", "-n"],
input="set -e\n" + self.cmd,
text=True,
capture_output=True,
)
self.assertEqual(0, res.returncode, res.stderr)
[FIX] script todo: ne plus laisser PyCharm manger la compilation mobile Sur erplibre-ubuntu-2604-gnome, l'APK s'est fait tuer par le noyau. La cause est ici : « $! » désigne xvfb-run, un script, et le tuer n'atteint ni PyCharm ni Xvfb — l'IDE tournait encore 45 minutes après son étape, avec 1,9 Go, quand Gradle a demandé ses 6,8 Go sur 12. C'est le GROUPE qu'on tue maintenant, et plus rien ne survit : mesuré, 2 Go rendus. Le .idea n'était jamais écrit non plus : 122 684 des 123 021 fichiers d'assets du dépôt mobile épuisaient les 65 536 watches inotify. Relevées à 524288, le projet se crée. Restent 4 Go de swap avant de compiler, et un diagnostic qui nomme la mémoire — avec le compte de l'oom-killer — puis la limite ZIP de 65 535 entrées, sur laquelle la compilation bute désormais, en amont. --- EN --- On erplibre-ubuntu-2604-gnome the APK was killed by the kernel. The cause is here: "$!" is xvfb-run, a script, and killing it reaches neither PyCharm nor Xvfb — the IDE was still running 45 minutes after its step, holding 1.9 GB, when Gradle asked for its 6.8 GB out of 12. The GROUP is killed now, and nothing survives it: 2 GB given back, measured. The .idea was never written either: 122,684 of the mobile repo's 123,021 asset files exhausted the 65,536 inotify watches. Raised to 524288, the project gets created. Also 4 GB of swap before building, and a diagnostic naming memory — with the oom-killer count — then the 65,535-entry ZIP limit the build now hits, upstream of us. Assisted-by: Claude Opus 5
2026-08-19 05:38:01 -04:00
def test_the_ide_gets_its_own_process_group(self):
"""Sans « setsid », il n'y a pas de groupe à tuer."""
self.assertIn("setsid xvfb-run", self.cmd)
def test_the_whole_group_is_killed_not_just_the_wrapper(self):
"""Le signe moins est tout le correctif : « -$pid » désigne le GROUPE,
donc xvfb-run, Xvfb, pycharm et les cef_server."""
self.assertIn("kill -TERM -$pid", self.cmd)
self.assertIn("kill -KILL -$pid", self.cmd)
def test_inotify_is_raised_before_opening(self):
"""Après l'ouverture, il serait trop tard : l'analyse a déjà échoué."""
pos_watch = self.cmd.index("max_user_watches")
pos_open = self.cmd.index("setsid xvfb-run")
self.assertLess(pos_watch, pos_open)
self.assertIn("524288", self.cmd)
def test_the_leftover_count_is_a_single_number(self):
"""« pgrep -fc » imprime 0 ET rend 1 quand il ne trouve rien : le
« || echo 0 » ajoutait un second zéro, et « 0\n0 » n'est pas « 0 ».
Le filet se déclenchait donc à chaque passage."""
self.assertIn("| wc -l", self.cmd)
self.assertNotIn("pgrep -fc", self.cmd)
def test_it_is_valid_shell(self):
res = subprocess.run(
["bash", "-n"], input=self.cmd, capture_output=True, text=True
)
self.assertEqual(0, res.returncode, res.stderr)
def test_the_group_kill_really_reaps_the_children(self):
"""Le test qui compte : on rejoue l'étape avec de FAUX pycharm et
xvfb-run, celui-ci laissant un enfant derrière lui comme le vrai le
fait avec Xvfb. Rien ne doit survivre."""
import os
import tempfile
import time
with tempfile.TemporaryDirectory() as tmp:
bin_dir = pathlib.Path(tmp) / "bin"
bin_dir.mkdir()
repo = pathlib.Path(tmp) / "repo"
(repo / ".idea").mkdir(parents=True)
# .idea déjà là : l'attente sort au premier tour, et le test
# mesure la FERMETURE, pas la création.
(repo / ".idea" / "erplibre.iml").write_text("<module/>")
(repo / ".idea" / "misc.xml").write_text("<project/>")
marker = pathlib.Path(tmp) / "alive"
(bin_dir / "xvfb-run").write_text(
"#!/bin/bash\n"
# L'enfant qui survivait : un Xvfb que personne ne tuait.
f"( while true; do touch {marker}; sleep 1; done ) &\n"
'shift; exec "$@"\n'
)
(bin_dir / "pycharm").write_text(
"#!/bin/bash\nwhile true; do sleep 1; done\n"
)
(bin_dir / "sudo").write_text("#!/bin/bash\nexit 0\n")
(bin_dir / "python3").write_text("#!/bin/bash\ncat > /dev/null\n")
for name in ("xvfb-run", "pycharm", "sudo", "python3"):
(bin_dir / name).chmod(0o755)
cmd = self.todo._qemu_pycharm_project_cmd(False).replace(
self.todo._qemu_install_dir(False), str(repo)
)
env = dict(os.environ, PATH=f"{bin_dir}:/usr/bin:/bin", HOME=tmp)
res = subprocess.run(
["bash", "-c", cmd],
capture_output=True,
text=True,
env=env,
timeout=180,
)
self.assertEqual(0, res.returncode, res.stdout + res.stderr)
marker.unlink(missing_ok=True)
time.sleep(3)
# L'enfant réveillait le marqueur chaque seconde : s'il vit
# encore, le fichier est revenu.
self.assertFalse(
marker.exists(),
"un enfant a survécu à la fermeture du groupe",
)
class TestMobileSwap(unittest.TestCase):
"""Le swap posé avant de compiler, et son refus de bloquer.
Mesuré : le démon Gradle a atteint 6,8 Go de RSS hors tas — son -Xmx1536m
ne le borne pas — sur une VM de 12 Go SANS swap, et le noyau l'a tué deux
fois. « --max-workers=2 » n'a rien changé : le pic est passé de 10,3 à
11,2 Go. C'est de la marge qu'il faut."""
def setUp(self):
self.todo = TODO.__new__(TODO)
self.steps = self.todo._qemu_mobile_build_steps("/tmp/el")
def test_the_swap_comes_before_the_build(self):
self.assertLess(
self.steps.index("SwapTotal"), self.steps.index("npm ci")
)
def test_it_does_nothing_when_swap_is_already_there(self):
self.assertIn("SwapTotal", self.steps)
self.assertIn("-lt 2000000", self.steps)
def test_a_failed_swap_leaves_no_stray_file(self):
"""Un fichier d'échange à moitié fait occuperait 4 Go pour rien."""
self.assertIn("rm -f /swapfile-erplibre", self.steps)
def test_it_is_valid_shell(self):
res = subprocess.run(
["bash", "-n"],
input="mstep() { :; }\n" + self.steps,
capture_output=True,
text=True,
)
self.assertEqual(0, res.returncode, res.stderr)
def test_the_swap_block_is_not_linked_by_and(self):
"""Lié par « && », un swap refusé arrêterait toute la compilation."""
head = self.steps[: self.steps.index("npm ci")]
self.assertNotIn("fi; fi && ", head)
self.assertIn("fi; fi; ", head)
class TestMobileDiagMemory(unittest.TestCase):
"""« Son démon a disparu » ne parle pas de mémoire ; le diagnostic, oui."""
def setUp(self):
self.todo = TODO.__new__(TODO)
self.cmd = self.todo._qemu_mobile_diag_cmd()
def test_the_oom_pattern_names_memory(self):
pats = {p[0]: p[1] for p in TODO._QEMU_MOBILE_DIAG}
self.assertIn("daemon disappeared", pats)
self.assertIn("memory", pats["daemon disappeared"].lower())
def test_the_zip_entry_limit_is_named(self):
"""La panne d'aujourd'hui, et elle est en amont : un APK est un ZIP
borné à 65 535 entrées, et le dépôt mobile en embarque 122 684 sous
assets/public/repos pour 337 qui sont l'application. Le diagnostic doit
le dire, pas laisser lire 5 000 lignes de Gradle."""
pats = {e[0]: e[1] for e in TODO._QEMU_MOBILE_DIAG}
self.assertIn("Too many zip entries", pats)
self.assertIn("65535", pats["Too many zip entries"])
def test_the_zip_limit_is_named_before_the_generic_gradle_failure(self):
"""« FAILED » attrape tout : placé avant, il masquerait la vraie
cause — l'ordre du tableau est le diagnostic."""
keys = [e[0] for e in TODO._QEMU_MOBILE_DIAG]
self.assertLess(
keys.index("Too many zip entries"), keys.index("FAILED")
)
def test_the_cause_is_proven_not_assumed(self):
"""Le compte de l'oom-killer et la RAM viennent avec : une cause
« mémoire » sans chiffre serait une supposition de plus."""
self.assertIn("mmem()", self.cmd)
self.assertIn("MemTotal", self.cmd)
self.assertIn("oom-kill", self.cmd)
def test_it_runs_and_names_the_cause(self):
import os
import tempfile
with tempfile.TemporaryDirectory() as tmp:
bin_dir = pathlib.Path(tmp) / "bin"
bin_dir.mkdir()
# Un dmesg qui rapporte un oom-kill, via un sudo neutre.
(bin_dir / "sudo").write_text('#!/bin/bash\nshift 0; exec "$@"\n')
(bin_dir / "dmesg").write_text(
"#!/bin/bash\necho 'oom-kill:constraint=CONSTRAINT_NONE'\n"
)
for name in ("sudo", "dmesg"):
(bin_dir / name).chmod(0o755)
log = pathlib.Path(tmp) / "build.log"
log.write_text(
"> Task :app:compressDebugAssets\n"
"Gradle build daemon disappeared unexpectedly\n"
)
res = subprocess.run(
["bash", "-c", self.cmd + f'mdiag "{log}"'],
capture_output=True,
text=True,
env=dict(os.environ, PATH=f"{bin_dir}:/usr/bin:/bin"),
timeout=60,
)
out = res.stdout
# « RAM » et « OOM » traversent les deux langues ; le chiffre,
# lui, est ce qui distingue une cause prouvée d'une supposition.
self.assertIn("RAM", out)
self.assertRegex(out, r"\(OOM\)|OOM kills")
self.assertRegex(out, r"[0-9]+")
[FIX] todo qemu: open the PyCharm project without a screen, and unlicensed Two measurements, one after the other. The unified PyCharm that code=PCC&latest now serves stops on its licence: the log says NoValidIdeLicense then "Get licenses: request requires authentication", and no project is ever opened — so no .idea, so nothing for the install to configure. The Community line asks for no account and is still patched (2025.2.6.2 on 2026-07-29); it is resolved from the release feed, so no version is frozen here. That build then froze 1.3 s after startup: the trust dialog, invisible under Xvfb and waiting for a click. idea.trust.all.projects unblocks it. Checked on an Ubuntu 26.04 VM: .idea complete in 195 s, and pycharm_configuration.py writes its exclusions into erplibre.iml. --- FR --- Deux mesures, l'une après l'autre. Le PyCharm unifié que sert désormais code=PCC&latest s'arrête sur sa licence : le journal dit NoValidIdeLicense puis « Get licenses: request requires authentication », et aucun projet ne s'ouvre — donc pas de .idea, donc rien à configurer pour l'installation. La ligne Community ne demande aucun compte et reste corrigée (2025.2.6.2 le 2026-07-29) ; elle est résolue depuis le flux des versions, sans qu'aucun numéro ne soit figé ici. Ce build se figeait ensuite 1,3 s après le démarrage : la fenêtre de confiance, invisible sous Xvfb et attendant un clic. idea.trust.all.projects la lève. Vérifié sur une VM Ubuntu 26.04 : .idea complet en 195 s, et pycharm_configuration.py écrit ses exclusions dans erplibre.iml. Assisted-by: Claude Opus 5
2026-08-17 23:22:38 -04:00
[ADD] script todo: lancer l'émulateur Android et son tunnel adb Le tunnel n'était que du texte à recopier, et le démarrage restait manuel : un second émulateur sur le même AVD tue le premier (« Running multiple emulators »), rencontré deux fois. Le menu le détecte donc avant de lancer. La fenêtre décide du reste. Sans elle, todo.py démarre à distance, détaché par setsid dans le groupe kvm, et enchaîne sur scrcpy ; avec elle, la commande doit partir du poste qui possède l'affichage, pas d'ici. Mesuré : l'émulateur n'écoute que sur le 127.0.0.1 de la VM — l'hyperviseur est refusé sur IP:5555 — d'où le -J qui met la VM en dernier saut. Vérifié sur erplibre-mobile-proof : poignée de main adb CNXN rendant sdk_gphone64_x86_64, enveloppe détachée survivant au ssh ; 30 tests. --- EN --- The tunnel was only text to copy, and starting the emulator stayed manual: a second emulator on the same AVD kills the first ("Running multiple emulators"), hit twice. The menu now detects it before starting. The window decides the rest. Without one, todo.py starts it remotely, detached by setsid in the kvm group, and chains into scrcpy; with one, the command must run from the workstation that owns the display, not from here. Measured: the emulator only listens on the VM's 127.0.0.1 — the hypervisor is refused on IP:5555 — hence the -J putting the VM last. Verified on erplibre-mobile-proof: an adb CNXN handshake returning sdk_gphone64_x86_64, a detached wrapper outliving the ssh; 30 tests. Assisted-by: Claude Opus 5
2026-08-19 03:35:31 -04:00
class TestAvdStep(unittest.TestCase):
"""L'étape AVD, et ce qu'elle laisse comme piste dans le journal.
Le tunnel adb lui-même est vérifié dans test_qemu_emulator_menu.py, qui
couvre aussi le démarrage sans fenêtre et la question de la fenêtre.
"""
[ADD] todo qemu: offer the adb tunnel for scrcpy, X11-free X11 carries raw pixels: 0.62 megapixel per frame even after shrinking the screen, rendered in software. scrcpy receives an H.264 stream encoded BY the device, so the emulator runs with no window at all — no X11 anywhere. The tunnel menu gained a fourth kind, reusing the target list it already reads from ~/.ssh/config, ProxyJump included: the hard part was already solved there. It forwards 5555, the emulator's own adb port, not 5037: tunnelling the adb server would force the user to kill the one on their workstation, which holds the same port. Verified through the tunnel from the hypervisor: an adb CNXN handshake answers device::ro.product.name=sdk_gphone64_x86, exactly what adb connect does. ss -ltn in the VM confirms 5554, 5555 and 5037 all listen on 127.0.0.1. --- FR --- X11 transporte des pixels bruts : 0,62 mégapixel par image même après réduction de l'écran, en rendu logiciel. scrcpy reçoit un flux H.264 encodé PAR l'appareil, si bien que l'émulateur tourne sans aucune fenêtre — plus de X11 nulle part. Le menu de tunnel gagne un quatrième type, qui réutilise la liste de cibles qu'il lit déjà dans ~/.ssh/config, ProxyJump compris : le plus dur y était déjà résolu. Il redirige 5555, le port adb de l'émulateur lui-même, et non 5037 : tunneliser le serveur adb obligerait à tuer celui du poste, qui occupe le même port. Vérifié à travers le tunnel depuis l'hyperviseur : une poignée de main adb CNXN répond device::ro.product.name=sdk_gphone64_x86, ce que fait exactement adb connect. « ss -ltn » dans la VM confirme que 5554, 5555 et 5037 écoutent tous sur 127.0.0.1. Assisted-by: Claude Opus 5
2026-08-19 02:39:10 -04:00
def setUp(self):
self.todo = TODO.__new__(TODO)
[ADD] script todo: lancer l'émulateur Android et son tunnel adb Le tunnel n'était que du texte à recopier, et le démarrage restait manuel : un second émulateur sur le même AVD tue le premier (« Running multiple emulators »), rencontré deux fois. Le menu le détecte donc avant de lancer. La fenêtre décide du reste. Sans elle, todo.py démarre à distance, détaché par setsid dans le groupe kvm, et enchaîne sur scrcpy ; avec elle, la commande doit partir du poste qui possède l'affichage, pas d'ici. Mesuré : l'émulateur n'écoute que sur le 127.0.0.1 de la VM — l'hyperviseur est refusé sur IP:5555 — d'où le -J qui met la VM en dernier saut. Vérifié sur erplibre-mobile-proof : poignée de main adb CNXN rendant sdk_gphone64_x86_64, enveloppe détachée survivant au ssh ; 30 tests. --- EN --- The tunnel was only text to copy, and starting the emulator stayed manual: a second emulator on the same AVD kills the first ("Running multiple emulators"), hit twice. The menu now detects it before starting. The window decides the rest. Without one, todo.py starts it remotely, detached by setsid in the kvm group, and chains into scrcpy; with one, the command must run from the workstation that owns the display, not from here. Measured: the emulator only listens on the VM's 127.0.0.1 — the hypervisor is refused on IP:5555 — hence the -J putting the VM last. Verified on erplibre-mobile-proof: an adb CNXN handshake returning sdk_gphone64_x86_64, a detached wrapper outliving the ssh; 30 tests. Assisted-by: Claude Opus 5
2026-08-19 03:35:31 -04:00
def test_the_avd_step_points_at_the_tunnel(self):
[ADD] todo qemu: offer the adb tunnel for scrcpy, X11-free X11 carries raw pixels: 0.62 megapixel per frame even after shrinking the screen, rendered in software. scrcpy receives an H.264 stream encoded BY the device, so the emulator runs with no window at all — no X11 anywhere. The tunnel menu gained a fourth kind, reusing the target list it already reads from ~/.ssh/config, ProxyJump included: the hard part was already solved there. It forwards 5555, the emulator's own adb port, not 5037: tunnelling the adb server would force the user to kill the one on their workstation, which holds the same port. Verified through the tunnel from the hypervisor: an adb CNXN handshake answers device::ro.product.name=sdk_gphone64_x86, exactly what adb connect does. ss -ltn in the VM confirms 5554, 5555 and 5037 all listen on 127.0.0.1. --- FR --- X11 transporte des pixels bruts : 0,62 mégapixel par image même après réduction de l'écran, en rendu logiciel. scrcpy reçoit un flux H.264 encodé PAR l'appareil, si bien que l'émulateur tourne sans aucune fenêtre — plus de X11 nulle part. Le menu de tunnel gagne un quatrième type, qui réutilise la liste de cibles qu'il lit déjà dans ~/.ssh/config, ProxyJump compris : le plus dur y était déjà résolu. Il redirige 5555, le port adb de l'émulateur lui-même, et non 5037 : tunneliser le serveur adb obligerait à tuer celui du poste, qui occupe le même port. Vérifié à travers le tunnel depuis l'hyperviseur : une poignée de main adb CNXN répond device::ro.product.name=sdk_gphone64_x86, ce que fait exactement adb connect. « ss -ltn » dans la VM confirme que 5554, 5555 et 5037 écoutent tous sur 127.0.0.1. Assisted-by: Claude Opus 5
2026-08-19 02:39:10 -04:00
"""La question vient juste après « c'est trop lent » : la réponse doit
être à portée de journal."""
self.assertIn("tunnel > 4", self.todo._qemu_avd_remote_cmd())
[ADD] todo qemu: offer PyCharm, Android Studio and GNOME extensions A graphical VM was a desktop and nothing else: every developer tool had to be installed by hand afterwards. A check list now carries them, filtered per machine — Android Studio is x86_64 only, Google publishes no Linux aarch64 build — and their disk cost reaches the plan before any qcow2 is created. They are installed BEFORE the clone: PyCharm writes the .idea/ of the repository, and the install that follows is what runs pycharm_configuration.py, through update_env_version.pycharm_update(). Its launcher is named studio, which is enough to conclude the install failed; it now answers to android-studio too. GNOME extensions come from the site by UUID, per running Shell: the same endpoint serves gTile v59 for GNOME 46 and v62 for 48. Checked with stubs: every tool can fail and the install's exit code still wins, 45 tests. --- FR --- Une VM graphique n'était qu'un bureau : chaque outil de développement restait à poser à la main. Une liste à cocher les porte, filtrés machine par machine — Android Studio n'existe qu'en x86_64, Google ne publiant aucune archive Linux aarch64 — et leur place disque atteint le plan avant qu'un seul qcow2 ne soit créé. Ils sont posés AVANT le clone : PyCharm écrit le .idea/ du dépôt, et c'est l'installation qui suit qui lance pycharm_configuration.py, via update_env_version.pycharm_update(). Son lanceur s'appelle studio, ce qui suffit à conclure à un échec ; il répond désormais aussi à android-studio. Les extensions GNOME viennent du site par UUID, selon le Shell qui tourne : le même point d'entrée sert gTile v59 pour GNOME 46 et v62 pour 48. Vérifié avec des leurres : chaque outil peut échouer sans que le code de sortie de l'installation ne change, 45 tests. Assisted-by: Claude Opus 5
2026-08-17 22:57:56 -04:00
class TestGnomeSiteExtensions(unittest.TestCase):
"""Extensions posées depuis extensions.gnome.org, par leur UUID."""
def setUp(self):
self.todo = TODO.__new__(TODO)
self.block = self.todo._qemu_gnome_ext_remote_cmd()
def test_the_three_requested_extensions_are_there(self):
for uuid in (
"gTile@vibou",
"freon@UshakovVasilii_Github.yahoo.com",
"tracker@aliakseiz.github.com",
):
self.assertIn(uuid, self.block, uuid)
def test_the_archive_follows_the_running_gnome(self):
"""Le site sert une archive DIFFERENTE selon la version demandée —
gTile v59 en GNOME 46, v62 en 48 : figer une URL poserait une archive
faite pour une autre version."""
self.assertIn("shell_version=$sv", self.block)
self.assertIn("gnome-shell --version", self.block)
def test_valid_shell_and_never_fails_the_install(self):
script = "set -e\n" + self.block
self.assertEqual(
0,
subprocess.run(
["bash", "-n"], input=script, text=True, capture_output=True
).returncode,
)
# Sans gnome-shell dans le PATH, le bloc doit se taire proprement.
res = subprocess.run(
["bash", "-c", "PATH=/nonexistent; " + script],
capture_output=True,
text=True,
)
self.assertEqual(0, res.returncode, res.stderr)
def test_a_session_bus_is_provided_for_dconf(self):
"""Un « ssh hote commande » n'a pas de bus de session : sans lui,
l'activation ne peut rien ecrire dans dconf."""
self.assertIn("dbus-run-session", self.block)
if __name__ == "__main__":
unittest.main()