Master checklist + step A5 attivita + 'definizione di fatto' updated; A5-closeout.md added (116 pytest, coverage 80.10% total, gate raised to 80%). Hardware validation (burn-in 4x10 + workflow matrix end-to-end) deferred to user. Shim PS removal deferred to B5 (systemd timers): all 10 shims still referenced by Register-CIScheduledTasks.ps1 / docs / Test-*.ps1.
5.6 KiB
A5 — Closeout
Fase A5 di plans/implementation-plan-A-B.md: polish, regression test
per gli errori frequenti AGENTS.md #9-#12, documentazione Python
allineata, gate coverage alzato a 80%.
Branch: feature/python-rewrite-phase-a.
Stato attuale
tests/python/test_agents_errors.pyaggiunto: 12 test dedicati che coprono regressioni perAGENTS.md"Errori frequenti da evitare" #9, #10, #11, #12.- #9 (snapshot template con VM accesa):
clone_linkedpropaga "should not be powered on" comeBackendOperationFailed(subclass diBackendError) conoperation == "clone"eoutputche contiene il messaggio originale divmrun. - #10 (
vmrun getGuestIPAddresslento):is_runningusa solovmrun list. Tre asserzioni — happy path, VM non listata, errore divmrun list— verificano chegetGuestIPAddressnon venga MAI chiamato come fallback. - #11 (machine-id duplicato → DHCP collision): la safety net
orchestrator-side è che
vm newnon riusi mai un clone-name (timestamp suffix); il test invocavm newdue volte con lo stesso--job-ide verifica checlone_linkedriceva duename/destinationdistinti. Il fix template-side (truncate -s 0 /etc/machine-id) resta documentato intemplate/Prepare-LinuxBuild2404.ps1. - #12 (
& nativecmd 2>$nullnon sopprime stderr in PS 5.1):SshTransportusaparamiko.AutoAddPolicydi default conknown_hosts=None, non chiama maisubprocess.run/Popen(inclusossh-keygen/ssh.exe/scp.exe), e wrappa errori paramiko (import mancante,exec_commandexception, SFTPput/get) comeTransportConnectErrorinvece di propagare eccezioni nude.
- #9 (snapshot template con VM accesa):
AGENTS.mdaggiornato: nuova sezione "Python development" subito dopo "PowerShell 5.1 — Vincoli critici", con tabella parametri, convenzioni (type hints, noAny/globali/print/shell=True), mappatura completa PS → Python sub-command, elenco PS che restano e gate coverage 80%.docs/ARCHITECTURE.mdesteso con sezione "Python orchestrator (Phase A)": layout package,VmBackendProtocol, factoryload_backend(config), ricetta Phase C per backend ESXi (backends/esxi.py+ selettore[backend]inconfig.toml), transport selection, gate CI.README.mdampliato: setup venv produzione + dev, esempi CLI per tutti i 10 sub-comandi (wait-ready,vm new/remove/cleanup,build run,artifacts collect,monitor disk/runner,report job,job), comandi validazione locale con gate 80%, link atest_agents_errors.pyepyproject.toml.- Suite completa: ruff clean, mypy --strict clean, 116 pytest PASS, coverage totale 80.10% (gate 80% raggiunto).
- Burn-in 4 job concorrenti × 10 round (versione Python di
Test-CapacityBurnIn) — richiede VM reali, lasciato a carico utente. - Workflow
build-nsInnoUnp.ymlmatrix (Win + Linux) end-to-end PASS — eredita pendenza da A4 (richiede runner registrato).
Definizione di "fatto" A5
| Criterio | Stato |
|---|---|
| Errori #9–#12 coperti da test pytest | ✅ |
AGENTS.md ha sezione "Python development" |
✅ |
docs/ARCHITECTURE.md aggiornato (layout + hook C) |
✅ |
README.md aggiornato (setup + esempi CLI) |
✅ |
| Coverage globale ≥80% (gate alzato in pyproject) | ✅ 80.10% |
| Shim PS non referenziati rimossi | ⏭️ nessuno candidato (vedi nota) |
| Burn-in 4×10 PASS | ⏳ utente — richiede VM reali |
Nota shim PS: tutti i 10 shim (Wait-VMReady.ps1, New-BuildVM.ps1,
Remove-BuildVM.ps1, Cleanup-OrphanedBuildVMs.ps1,
Invoke-RemoteBuild.ps1, Get-BuildArtifacts.ps1, Watch-DiskSpace.ps1,
Watch-RunnerHealth.ps1, Get-CIJobSummary.ps1, Invoke-CIJob.ps1)
sono ancora referenziati: Register-CIScheduledTasks.ps1 registra
scheduled task che invocano Watch-DiskSpace.ps1,
Watch-RunnerHealth.ps1, Cleanup-OrphanedBuildVMs.ps1; README.md
documenta Invoke-CIJob.ps1 per uso manuale; Test-*.ps1 di smoke
chiamano gli shim. Nessuno shim è candidato a rimozione in A5 senza
prima migrare anche Register-CIScheduledTasks.ps1 (Fase B5 lo
sostituirà con *.service + *.timer su systemd).
Cosa resta a carico utente
- Eseguire un burn-in concorrente (4 job × 10 round) usando il workflow
build-nsInnoUnp.ymlmatrix oscripts/Test-CapacityBurnIn.ps1(che ora delega via shim alla CLI Pythonjob) e verificare:- PASS senza VM orfane (
vm cleanupnon rimuove nulla a fine round). - Wall-clock entro ±20% del baseline pre-Python (
Measure-CIBenchmark.ps1).
- PASS senza VM orfane (
- Validare
build-nsInnoUnp.ymlmatrix (Win + Linux) end-to-end PASS sul runner reale — pendenza ereditata da A4. - Validare
self-test.ymlelint.ymlpost-switch.
Riferimenti commit
test(a5): add pytest regression tests for AGENTS.md errors #9-#12—tests/python/test_agents_errors.pydocs(a5): document Python orchestrator in AGENTS.md, ARCHITECTURE.md, README.md—AGENTS.md,docs/ARCHITECTURE.md,README.mddocs(a5): mark A5 as code-complete; add A5-closeout.md—plans/implementation-plan-A-B.md,plans/A5-closeout.md