Skip to content

apply, pods, web: tests from a mutation-testing campaign - #108

Merged
tire-fire merged 22 commits into
mainfrom
mutation-tests
Nov 20, 2026
Merged

tire-fire merged 22 commits into
mainfrom
mutation-tests

Conversation

@tire-fire

Copy link
Copy Markdown
Collaborator

124 behavioural tests (apply 39, pods 76, web 9) plus stronger existing ones,
written to kill mutants gremlins left alive in internal/apply, internal/pods and
the internal/web review and authorization paths. Production code changes are only
three deletions of checks that could never fail, each in its own commit
(unfollowable's qmclone check, Environments' template skip, SetOfPattern's
empty-set check; that last commit's message credits ParseSet, but it's
SetOfPattern's own rest == "" check, after trimming, that already refuses an empty
set). The timing-sensitive tests run under testing/synctest or wait on signals, not
sleeps. Scores rose from 84% to 93% (apply) and 85% to 98% (pods) by gremlins'
efficacy, and 52% to 96% on the targeted web paths. Every mutant still alive has a
recorded reason (equivalent, a guard kept on purpose, or not compilable), except
templates.go:242:33, which PR 3's fix kills. Notable gap closed: nothing caught a
mutant that let anyone with privileges cancel another person's job with no VMs;
the code was right, and TestCancelOfAJobWithNoVMs now pins it.

Stacked on #105 (fix/go-1.27.4); review only this branch's commits. Merge after that PR.

Pin behaviour surviving mutants showed untested: a failed listing's
retry round and error keeping, stops before or during a round and
RoundsSkipped, power items left untouched, a torn-down item resuming at
its clone, Held refusals in a step, unfollowable tasks with no VM or a
lock still held, resent snapshot requests, and half-deleted and
leftover-disk error texts.
…ants

Pin behaviour that mutation testing showed unchecked: reboot of a stopped
VM, clone and delete events, failures after a cancel, retire on a moved
or replaced previous version, probe of a locked clone target, rebuild of
a team VM gone since planning, guest agent waits and verify reports,
cleanup order, budget and per-copy outcomes, unconfirmed deletes, leftover
base disks under the storage-ops slot, and the copy-stop and convert waits.
Every clone passes its target VMID to taskUPID, so a zero vmid never
comes with a clone's UPID; the check could not fail.
A template is read only when it is in a slot's pool, and the pool branch handles it first, so the skip could never run.
… no VMs

Kills surviving mutants in confirm.go and jobpages.go: a confirm at another
environment's Add hosts path is refused, a wrong typed confirm says what was
typed, the submit flash names one pod or several, and a job with no VMs is
cancelled only by whoever started it.
ParseSet already refuses an empty set, so the check could not fail.
Run the stop-while-locked and leftover-disk tests under synctest, gate the copy-stop test on its event, and stop pinning cleanup's incidental delete order.
podstest.Guest gains SSHExit and the Fake records SSH checks, replacing liveaddr_test's sshAgent wrapper. Drop two EnvEdit tests TestEnvEditItem already covers, share a hostSpecs helper in envplan tests, and correct Environments' docstring on templates.
Base automatically changed from fix/go-1.27.4 to main November 20, 2026 13:53
@tire-fire
tire-fire merged commit 438d431 into main Nov 20, 2026
8 checks passed
@tire-fire
tire-fire deleted the mutation-tests branch November 20, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant