Files
devvm/docs
w3cjandClaude Opus 5.5 ffbc139969 test(lima): a contract test of the limactl stub against real Lima
TestLimactlStubContract runs scenario on dummy instances twice, through
the real limactl and through testdata/stubs/limactl, and after each step
compares every instance as devvm reads it from limactl list --json: their
order, status, size, mounts, agent forwarding, ssh port and networks, and
the edits each kind of start would make (startSets).

The stub had drifted from Lima, and now matches it:
- create ignored --cpus= and --memory=: every image was 4 CPUs and 8 GiB.
- clone started from an empty config: Lima's keeps its source's config,
  size and lima.yaml (env), then --mount-none, then each --set.
- Only --set .portForwards, .ssh.localPort and .env were kept: the
  mounts, .ssh.forwardAgent, .propagateProxyEnv, .hostResolver and .dns
  were dropped, so each start edited them again. The stub keeps any
  --set (and del()) in $STUB_DIR/config-<name>/, on create too.
- delete left the VM's size and $LIMA_HOME/<name> (its lima.yaml).
- list gave instances in the order they were made: Lima sorts them.

devvm relied on the clone drift: a project VM keeps its image's
propagateProxyEnv: false (from the build's start), so its first start
without network policy edited it, where the CLI tests said it edits
nothing. CreateVM now sets .propagateProxyEnv=true at the clone. And
rebuild.txtar relied on the list order: it compares the deletes sorted,
as Lima lists images by name. On Linux a layer's or the tools build's
VM, cloned from a built image, keeps the config its image's build made,
so Start edits nothing (no ssh port there) and the build's step count
was one too many: cloneEdits counts the configure step only when Start
edits (TestCloneEdits).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 14:11:57 -07:00
..