diff --git a/LongTest/README.base.md b/long_test/README.base.md similarity index 95% rename from LongTest/README.base.md rename to long_test/README.base.md index 50fbd93..9b7ccb0 100644 --- a/LongTest/README.base.md +++ b/long_test/README.base.md @@ -4,7 +4,7 @@ -# 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. -# 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 diff --git a/LongTest/README.fr.md b/long_test/README.fr.md similarity index 94% rename from LongTest/README.fr.md rename to long_test/README.fr.md index 55137c3..b87c56b 100644 --- a/LongTest/README.fr.md +++ b/long_test/README.fr.md @@ -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 diff --git a/LongTest/README.md b/long_test/README.md similarity index 94% rename from LongTest/README.md rename to long_test/README.md index 6158c24..4686619 100644 --- a/LongTest/README.md +++ b/long_test/README.md @@ -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 diff --git a/LongTest/deep_proxmox.py b/long_test/deep_proxmox.py similarity index 99% rename from LongTest/deep_proxmox.py rename to long_test/deep_proxmox.py index bd2be2f..bad92b6 100755 --- a/LongTest/deep_proxmox.py +++ b/long_test/deep_proxmox.py @@ -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 diff --git a/script/proxmox/nesting.py b/script/proxmox/nesting.py index 3acd18c..4c2c979 100644 --- a/script/proxmox/nesting.py +++ b/script/proxmox/nesting.py @@ -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. """ diff --git a/script/todo/longtest_menu.py b/script/todo/longtest_menu.py index 918da38..35c7e9f 100644 --- a/script/todo/longtest_menu.py +++ b/script/todo/longtest_menu.py @@ -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) diff --git a/script/todo/todo.py b/script/todo/todo.py index 0a5fb21..f27bd02 100755 --- a/script/todo/todo.py +++ b/script/todo/todo.py @@ -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 diff --git a/test/test_todo_longtest.py b/test/test_todo_longtest.py index c72c71a..1592262 100644 --- a/test/test_todo_longtest.py +++ b/test/test_todo_longtest.py @@ -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