Skip to content

Test hygiene: skipped tests show as skipped, no vacuous checks, temp folders removed, a flake gate on main - #276

Merged
Mpdreamz merged 5 commits into
mainfrom
chore/test-hygiene
Nov 16, 2026
Merged

Mpdreamz merged 5 commits into
mainfrom
chore/test-hygiene

Conversation

@Mpdreamz

Copy link
Copy Markdown
Contributor

Test hygiene: checks that could pass without testing anything now fail or show as skipped, tests clean up the folders they make, and CI on main names flaky tests.

  • Tutor check guard in CI. scripts/tutor-check.sh holds the summary-line guard. mise run tutor-check and CI's build job both run it, so an app that exits early fails in CI too.
  • Flake gate. On pushes to main the test job runs the suite a second time (mise run test --skip-build). scripts/flaky-tests.sh compares the failing test names from the two logs and fails the job naming each test that failed in only one run. It reads both recorded an issue and failed after lines, because a parameterized test that fails prints no failed after line under --quiet. Nothing is retried. Pull requests still run the suite once.
  • Skips are reported as skipped. The ssh-host suites, the pane launch tests (python3, zmx), the fish tests in HostRoots and ShellCommand, the real-zmx test and the built-helper origin hook test now use .enabled(if:) with what they need, instead of guard … else { return }.
  • Vacuous assertions. Each allSatisfy flagged in the audit, plus the clear ones a sweep found, now also checks a count or that the collection is not empty. outsideHeedsPanesIsNeverYou now asserts the answer is refused and the question stays unanswered. Its old exit != .ok || … short-circuited and never checked the steering rows. aReportTheBranchCarriesIsNotRead now shows the branch's report would read as fresh, and runs clearLeftovers to check the report is gone.
  • Temporary folders. A .scratch trait (Tests/HeedCoreTests/Scratch.swift, a TestScoping trait) gives each test a root under the temp directory and removes it afterwards. Helpers that made folders without removing them now use Scratch.folder. One-off folders got a defer. The Audit*Tests are not touched, because fix/audit-integrity is changing them. GitEnvironmentTests already removed its folder.

Verification: mise run lint passes. mise run test passes apart from the known interactiveCallsGoFirst under load. Mutations were applied and then reverted:

  • An empty call-log filter fails logged.count == 3.
  • A no-op clearLeftovers fails the run-folder test.
  • Treating an unknown caller as you fails the steering test.
  • A changed setup-failure message fails aFailedSetupLeavesAShell.
  • A shallower probe depth fails theProbeRunsFromFish.
  • A no-op Zmx.kill fails the real-zmx test.

The flake script was run against real suite output. The tutor-check guard was tested with stub apps: no summary fails, a summary passes, and a non-zero exit is passed on.

Untested: both CI workflow changes. They only show when running on CI, and the flake gate only runs on a push to main.

🤖 Generated with Claude Code

Mpdreamz and others added 5 commits November 16, 2026 15:56
…un tutor-check does, through one shared script

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…y test that failed in only one run as flaky

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ort as skipped without it instead of passing

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… a per-test root that the .scratch trait removes

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… and the run-folder and steering tests assert what they describe

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the chore Maintenance label Nov 16, 2026
@Mpdreamz
Mpdreamz merged commit 0b8a050 into main Nov 16, 2026
5 checks passed
@Mpdreamz
Mpdreamz deleted the chore/test-hygiene branch November 16, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant