[REF] long_test : renommer le répertoire selon la convention du dépôt

LongTest était le SEUL répertoire en CamelCase que nous ayons créé. Les deux
exceptions sous script/ — OCA_maintainer-tools, OCA_odoo-module-migrator —
sont des noms de dépôts amont tirés par Google Repo, pas les nôtres. Tout le
reste est en minuscules avec des soulignés : image_db, code_generator,
fork_github_repo, shell_script_odoo.

Le nom avait été repris tel qu'il m'avait été dicté, sans être confronté à la
convention — le contrôle même que le reste de ce travail applique partout.

50 occurrences dans 8 fichiers. Le menu TODO résout le nouveau chemin, l'essai
à blanc passe, et les 125 tests des trois fichiers touchés restent verts.

--- EN ---

LongTest was the ONLY CamelCase directory we created. The two exceptions under
script/ — OCA_maintainer-tools, OCA_odoo-module-migrator — are upstream repo
names pulled by Google Repo, not ours. Everything else is lowercase with
underscores: image_db, code_generator, fork_github_repo, shell_script_odoo.

The name had been taken as dictated, without being checked against the
convention — the very check the rest of this work applies everywhere.

50 occurrences across 8 files. The TODO menu resolves the new path, the dry run
passes, and the 125 tests in the three touched files stay green.

Assisted-by: claude-opus-5
(cherry picked from commit 170ee61e50dfeff638c84c07eadac00c62526e4d)
This commit is contained in:
Mathieu Benoit 2026-08-28 00:50:02 -04:00
parent 8e5f5b9097
commit 84ec78a61d
8 changed files with 50 additions and 50 deletions

View file

@ -4,7 +4,7 @@
<!---------------------------->
<!-- [en] -->
# LongTest — tests that create real machines
# long_test — tests that create real machines
These are not unit tests. They create virtual machines, install systems on
them, and take hours. They live here and **not** in `test/`, which the unit
@ -33,10 +33,10 @@ Which is the point of the script: a number obtained once, on one machine, in
one chain, is an anecdote.
```
./LongTest/deep_proxmox.py # three levels, ~30 minutes
./LongTest/deep_proxmox.py --dry-run # the plan, nothing created
./LongTest/deep_proxmox.py --depth 5 # ask for more, knowingly
./LongTest/deep_proxmox.py --detruire # undo it
./long_test/deep_proxmox.py # three levels, ~30 minutes
./long_test/deep_proxmox.py --dry-run # the plan, nothing created
./long_test/deep_proxmox.py --depth 5 # ask for more, knowingly
./long_test/deep_proxmox.py --detruire # undo it
```
### How deep is worth asking for
@ -133,7 +133,7 @@ promises a depth it knows will not fit — better to announce six levels and
reach six than to promise ten and die at the seventh without knowing why.
<!-- [fr] -->
# LongTest — des tests qui créent de vraies machines
# long_test — des tests qui créent de vraies machines
Ce ne sont pas des tests unitaires. Ils créent des machines virtuelles, y
installent des systèmes, et durent des heures. Ils vivent ici et **non** dans
@ -166,10 +166,10 @@ D'où le script : un chiffre obtenu une fois, sur une machine, dans une chaîne,
est une anecdote.
```
./LongTest/deep_proxmox.py # trois étages, ~30 minutes
./LongTest/deep_proxmox.py --dry-run # le plan, rien de créé
./LongTest/deep_proxmox.py --depth 5 # en demander plus, sciemment
./LongTest/deep_proxmox.py --detruire # défaire
./long_test/deep_proxmox.py # trois étages, ~30 minutes
./long_test/deep_proxmox.py --dry-run # le plan, rien de créé
./long_test/deep_proxmox.py --depth 5 # en demander plus, sciemment
./long_test/deep_proxmox.py --detruire # défaire
```
### Quelle profondeur vaut la peine d'être demandée

View file

@ -1,5 +1,5 @@
# LongTest — des tests qui créent de vraies machines
# long_test — des tests qui créent de vraies machines
Ce ne sont pas des tests unitaires. Ils créent des machines virtuelles, y
installent des systèmes, et durent des heures. Ils vivent ici et **non** dans
@ -32,10 +32,10 @@ D'où le script : un chiffre obtenu une fois, sur une machine, dans une chaîne,
est une anecdote.
```
./LongTest/deep_proxmox.py # trois étages, ~30 minutes
./LongTest/deep_proxmox.py --dry-run # le plan, rien de créé
./LongTest/deep_proxmox.py --depth 5 # en demander plus, sciemment
./LongTest/deep_proxmox.py --detruire # défaire
./long_test/deep_proxmox.py # trois étages, ~30 minutes
./long_test/deep_proxmox.py --dry-run # le plan, rien de créé
./long_test/deep_proxmox.py --depth 5 # en demander plus, sciemment
./long_test/deep_proxmox.py --detruire # défaire
```
### Quelle profondeur vaut la peine d'être demandée

View file

@ -1,5 +1,5 @@
# LongTest — tests that create real machines
# long_test — tests that create real machines
These are not unit tests. They create virtual machines, install systems on
them, and take hours. They live here and **not** in `test/`, which the unit
@ -28,10 +28,10 @@ Which is the point of the script: a number obtained once, on one machine, in
one chain, is an anecdote.
```
./LongTest/deep_proxmox.py # three levels, ~30 minutes
./LongTest/deep_proxmox.py --dry-run # the plan, nothing created
./LongTest/deep_proxmox.py --depth 5 # ask for more, knowingly
./LongTest/deep_proxmox.py --detruire # undo it
./long_test/deep_proxmox.py # three levels, ~30 minutes
./long_test/deep_proxmox.py --dry-run # the plan, nothing created
./long_test/deep_proxmox.py --depth 5 # ask for more, knowingly
./long_test/deep_proxmox.py --detruire # undo it
```
### How deep is worth asking for

View file

@ -24,9 +24,9 @@ dépôt : c'est notre code qu'on veut éprouver, et le dépôt distant est souve
en retard sur le checkout — un correctif absent du distant a fait « revenir »
le même défaut sur trois VM de suite.
./LongTest/deep_proxmox.py --depth 10 --dry-run
./LongTest/deep_proxmox.py --depth 10
./LongTest/deep_proxmox.py --detruire # défait ce que la descente a posé
./long_test/deep_proxmox.py --depth 10 --dry-run
./long_test/deep_proxmox.py --depth 10
./long_test/deep_proxmox.py --detruire # défait ce que la descente a posé
"""
import argparse

View file

@ -43,7 +43,7 @@ Deux nombres viennent de la même mesure, et méritent d'être dits :
Une descente complète a ensuite RÉFUTÉ ce qu'on avait conclu de la première :
son quatrième étage, à 2 vCPU, a démarré, s'est installé, et a écrit des
gigaoctets. Le plafond était celui du parallélisme sous imbrication, pas celui
de l'imbrication. La profondeur RÉELLEMENT atteignable se mesure — LongTest la
de l'imbrication. La profondeur RÉELLEMENT atteignable se mesure — long_test la
mesure ; ce module ne calcule que ce qui est arithmétiquement possible.
"""

View file

@ -3,7 +3,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
"""Les tests LONGS : de vraies machines, des heures.
Ils vivent dans `LongTest/` et non dans `test/`, et ce n'est pas un rangement
Ils vivent dans `long_test/` et non dans `test/`, et ce n'est pas un rangement
de confort : le lanceur unitaire balaie `test/test_*.py` et doit rester
lançable en quelques secondes, partout. Un test qui crée dix VM n'a rien à y
faire — il le ferait échouer sur toute machine sans virtualisation, et
@ -21,10 +21,10 @@ import click
from script.todo.todo_i18n import t
# Le répertoire des tests longs, à la racine du dépôt.
LONGTEST_DIR = "LongTest"
LONGTEST_DIR = "long_test"
class LongTestMenuMixin:
class long_testMenuMixin:
def _longtest_script(self, nom):
"""Chemin d'un test long, ou "" s'il n'est pas là."""
chemin = os.path.join(os.getcwd(), LONGTEST_DIR, nom)

View file

@ -28,7 +28,7 @@ from script.config import config_file
from script.execute import execute
from script.todo import todo_prefs
from script.todo.database_manager import DatabaseManager
from script.todo.longtest_menu import LongTestMenuMixin
from script.todo.longtest_menu import long_testMenuMixin
from script.todo.proxmox_menu import ProxmoxMenuMixin
from script.todo.qemu_access import QemuAccessMixin
from script.todo.qemu_deploy import QemuDeployMixin
@ -97,7 +97,7 @@ class TODO(
QemuManageMixin,
QemuAccessMixin,
ProxmoxMenuMixin,
LongTestMenuMixin,
long_testMenuMixin,
):
def __init__(self):
self.dir_path = None

View file

@ -29,18 +29,18 @@ PYTHON = os.path.join(RACINE, ".venv.erplibre/bin/python")
class TestLaFrontiere(unittest.TestCase):
"""LongTest est hors de portée du lanceur unitaire, et ce n'est pas un
"""long_test est hors de portée du lanceur unitaire, et ce n'est pas un
rangement de confort."""
def test_the_unit_runner_does_not_sweep_LongTest(self):
def test_the_unit_runner_does_not_sweep_long_test(self):
with open(
os.path.join(RACINE, "script/test/run_unit_test.sh"),
encoding="utf-8",
) as fh:
lanceur = fh.read()
# Le lanceur ne liste que des fichiers de test/ : rien qui parte de
# LongTest, sinon la suite unitaire créerait des VM.
self.assertNotIn("LongTest", lanceur)
# long_test, sinon la suite unitaire créerait des VM.
self.assertNotIn("long_test", lanceur)
def test_the_runner_only_looks_under_test(self):
"""Le lanceur balaie TOUT test/test_*.py depuis qu'une liste de
@ -48,24 +48,24 @@ class TestLaFrontiere(unittest.TestCase):
La frontière n'est donc plus un nom mais un RÉPERTOIRE : ce qui doit
rester hors de la suite doit vivre ailleurs que dans test/. C'est
exactement pourquoi LongTest est à la racine."""
exactement pourquoi long_test est à la racine."""
with open(
os.path.join(RACINE, "script/test/run_unit_test.sh"),
encoding="utf-8",
) as fh:
lanceur = fh.read()
self.assertIn("test/test_*.py", lanceur)
# Aucun chemin du lanceur ne sort de test/ : sinon LongTest y
# Aucun chemin du lanceur ne sort de test/ : sinon long_test y
# entrerait par la porte de service.
self.assertNotIn("LongTest", lanceur)
self.assertNotIn("long_test", lanceur)
def test_the_script_is_executable_and_documented(self):
script = os.path.join(RACINE, "LongTest/deep_proxmox.py")
script = os.path.join(RACINE, "long_test/deep_proxmox.py")
self.assertTrue(os.access(script, os.X_OK), "doit être exécutable")
# La doc est un .base.md : un .md généré se perd au prochain
# « make doc_markdown ».
self.assertTrue(
os.path.exists(os.path.join(RACINE, "LongTest/README.base.md"))
os.path.exists(os.path.join(RACINE, "long_test/README.base.md"))
)
@ -86,7 +86,7 @@ class TestLEssaiABlanc(unittest.TestCase):
cls.res = subprocess.run(
[
PYTHON,
os.path.join(RACINE, "LongTest/deep_proxmox.py"),
os.path.join(RACINE, "long_test/deep_proxmox.py"),
"--depth",
"4",
"--dry-run",
@ -160,7 +160,7 @@ class TestLEssaiABlanc(unittest.TestCase):
import inspect
import sys as _sys
_sys.path.insert(0, os.path.join(RACINE, "LongTest"))
_sys.path.insert(0, os.path.join(RACINE, "long_test"))
import deep_proxmox
src = inspect.getsource(deep_proxmox.Descente.creer_etage1)
@ -239,7 +239,7 @@ class TestLaProfondeurParDefaut(unittest.TestCase):
import inspect
import sys as _sys
_sys.path.insert(0, os.path.join(RACINE, "LongTest"))
_sys.path.insert(0, os.path.join(RACINE, "long_test"))
import deep_proxmox
src = inspect.getsource(deep_proxmox.principal)
@ -283,7 +283,7 @@ class TestDefaireSansEffacerAutreChose(unittest.TestCase):
emporte les disques ET les entrées de sauvegarde."""
def setUp(self):
sys.path.insert(0, os.path.join(RACINE, "LongTest"))
sys.path.insert(0, os.path.join(RACINE, "long_test"))
import deep_proxmox
self.dp = deep_proxmox
@ -359,7 +359,7 @@ class TestUnRapportQuiSurvitAuProcessus(unittest.TestCase):
"""
def setUp(self):
sys.path.insert(0, os.path.join(RACINE, "LongTest"))
sys.path.insert(0, os.path.join(RACINE, "long_test"))
import deep_proxmox
self.dp = deep_proxmox
@ -461,7 +461,7 @@ class TestNeJamaisDetruireSousUneDescenteVivante(unittest.TestCase):
aurait emporté l'arbre sous le processus qui installait encore."""
def setUp(self):
sys.path.insert(0, os.path.join(RACINE, "LongTest"))
sys.path.insert(0, os.path.join(RACINE, "long_test"))
import deep_proxmox
self.dp = deep_proxmox
@ -628,7 +628,7 @@ class TestLEtage1SIdentifiePasParSonNom(unittest.TestCase):
l'identifie vraiment."""
def setUp(self):
sys.path.insert(0, os.path.join(RACINE, "LongTest"))
sys.path.insert(0, os.path.join(RACINE, "long_test"))
import deep_proxmox
self.dp = deep_proxmox
@ -729,7 +729,7 @@ class TestLaCauseDUnMontageAbsent(unittest.TestCase):
lent que son hôte."""
def setUp(self):
sys.path.insert(0, os.path.join(RACINE, "LongTest"))
sys.path.insert(0, os.path.join(RACINE, "long_test"))
import deep_proxmox
self.dp = deep_proxmox
@ -791,7 +791,7 @@ class TestUneLectureRateeNeConclutRien(unittest.TestCase):
on posait un pont et un NAT sur une machine qui en avait déjà un."""
def setUp(self):
sys.path.insert(0, os.path.join(RACINE, "LongTest"))
sys.path.insert(0, os.path.join(RACINE, "long_test"))
import deep_proxmox
self.dp = deep_proxmox
@ -862,7 +862,7 @@ class TestUneVmCreeeEstToujoursNommee(unittest.TestCase):
pouvait pas la défaire, et il fallait la retrouver par son NOM."""
def setUp(self):
sys.path.insert(0, os.path.join(RACINE, "LongTest"))
sys.path.insert(0, os.path.join(RACINE, "long_test"))
import deep_proxmox
self.dp = deep_proxmox
@ -930,7 +930,7 @@ class TestNePasAttendreUneMaisonDisparue(unittest.TestCase):
plus."""
def setUp(self):
sys.path.insert(0, os.path.join(RACINE, "LongTest"))
sys.path.insert(0, os.path.join(RACINE, "long_test"))
import deep_proxmox
self.dp = deep_proxmox
@ -1013,7 +1013,7 @@ class TestLeDecompteDeLaDestruction(unittest.TestCase):
reste alloué s'affichait toujours — on apprend à ne plus le lire."""
def setUp(self):
sys.path.insert(0, os.path.join(RACINE, "LongTest"))
sys.path.insert(0, os.path.join(RACINE, "long_test"))
import deep_proxmox
self.dp = deep_proxmox