Skip to content

baseline_command's Desktop checkpoint fallback list is hardcoded and will go stale #5

Description

@rlnorthcutt

Problem

`baseline_command` (lab.sh:392-414) resolves the recommended Desktop-suite
checkpoint by checking a hardcoded, literal list:

```bash
for candidate in desktop-e2e-v2 podman-ready clean; do
if "$ENGINE" snapshots "$vm" | grep -Fxq "$candidate"; then
printf '%s\n' "$candidate"
return
fi
done
```

Checkpoints are named with incrementing version suffixes (see
`docs/checkpoints.md`'s own example of cutting `desktop-e2e-v3`). Once a
newer checkpoint like `desktop-e2e-v3` exists, this code still resolves to
the older `desktop-e2e-v2` (or falls further back to `clean`) instead of
finding it — the wrong baseline gets silently selected, with no error to
signal the drift.

Suggested fix

Instead of an ordered literal list, fetch the snapshot list once and pick the
highest `desktop-e2e-` entry via version sort (`sort -V`), only falling
back to `podman-ready` then `clean` if no `desktop-e2e-
` checkpoint
exists at all:

```bash
snapshots="$("$ENGINE" snapshots "$vm")"
newest="$(grep -E '^desktop-e2e-' <<<"$snapshots" | sort -V | tail -n1)"
```

Verified this resolves to `desktop-e2e-v2` against the existing
`tests/fake-engine.sh` fixture, so `tests/lab_test.sh` would keep passing
unmodified.

Files

  • `lab.sh` (`baseline_command`, ~line 403)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions