derives : refuser une fiche presentee qui ne se rafraichit pas

Generer avec la fiche deja tiree rendait peut-etre un inventaire faux (sur
les runners de production, d'avant le compte de sauvegarde). Refus, avec le
remede ; SETOPS_FICHE_PERIMEE=1 passe outre. Le 6b prouve sur la reprise :
empreintes du runner = empreintes du poste.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Daniel Allaire 2026-10-25 18:53:57 -04:00
parent a20f89ae2f
commit 48a454ffd1
3 changed files with 43 additions and 5 deletions

View file

@ -209,6 +209,24 @@ class Pas6b(unittest.TestCase):
g("add", "flux-genere"); g("-c", "user.name=t", "-c", "user.email=t@t", "commit", "-qm", "flux")
self.assertEqual(contexte.verifier_derives_non_versionnes(l), [])
def test_une_fiche_qui_ne_se_rafraichit_pas_arrete_tout(self):
import os
import subprocess
import derives
racine = Path(tempfile.mkdtemp())
(racine / "OPS-Fictif" / "plan").mkdir(parents=True)
(racine / "OPS-Fictif" / "plan" / "nomenclature.yml").write_text("index: 99\n", encoding="utf-8")
fiche = racine / "fiche-ops-fictif"
fiche.mkdir()
(fiche / "fiche-site.yml").write_text("site: S\n", encoding="utf-8")
subprocess.run(["git", "-C", str(fiche), "init", "-q"], check=True)
subprocess.run(["git", "-C", str(fiche), "remote", "add", "origin", str(racine / "nulle-part")], check=True)
with mock.patch.dict(os.environ, {"SETOPS_FICHE_PERIMEE": ""}):
with self.assertRaises(SystemExit):
derives.rafraichir_fiche(racine / "OPS-Fictif")
with mock.patch.dict(os.environ, {"SETOPS_FICHE_PERIMEE": "1"}):
self.assertIs(derives.rafraichir_fiche(racine / "OPS-Fictif"), False)
def test_les_cibles_qui_lisent_l_inventaire(self):
import derives
c = derives.cibles_qui_lisent()