mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 21:36:40 -10:00
backendtest.Conformance(t, factory) checks backend.Backend's documented contract, one subtest per check on a new backendtest.Subject (the backend holding one image, a folder of its own, Boots, Restart). Checks that need a running VM skip with the reason when Boots is false, and restart when Restart is nil. Checks: caps, problems, host (Host); images, delete-image, key-files, build-image (Images); create, create-refused, inspect-missing, stopped, start-shrink, proxy-url, rename, delete (Machines); start, confined, restart, reach, running-refused (running VMs); usage, strays, caches (Housekeeping); guard (the registry's guard refuses through Images and Machines alone). Runs: TestConformance and TestConformanceWithoutBooting on the fake; lima.TestConformance on the limactl stub (VMs start) and on real Lima's dummy instances (skips without limactl; running checks skipped, left to tests/e2e.sh). TestConformanceFinds checks ten broken fakes fail the check meant for them. Found and fixed in the fake: a start of a running VM gave it a new start and confinement; Restart kept a NetProxy start's Confined; a VM it made was confined while stopped or never started; CreateVM took a missing image, a name over NameLimit, and left its size unset (ImageVMSize); Rename took a name over NameLimit; SSH reached a stopped VM. Preset VMs keep their old Confined answer, which other packages' tests rely on. In the limactl stub: stop leaves ha.pid, and create and clone made no instance folder. Real Lima: nothing. Docs: contributing's How a backend plugs in. Coverage baselines raised: backendtest 46.5 to 74.4 (both), backend 97.0, lima 89.5 (darwin). Co-Authored-By: Claude Opus 5.5 <[email protected]>