Skip to content

refactor(tests): trim test comments and fix the ghcr login flake - #28

Merged
ttncode merged 2 commits into
mainfrom
refactor/tests-shell
Sep 16, 2026
Merged

ttncode merged 2 commits into
mainfrom
refactor/tests-shell

Conversation

@ttncode

@ttncode ttncode commented Sep 16, 2026

Copy link
Copy Markdown
Owner

What this changes

PR 4 of 5 (spec: docs/superpowers/specs/2026-09-16-clean-shell-and-comments-design.md). Covers the shell under tests/.

  • Comments: removes history, dates and incident counts, and prose that repeats the test name. One-line comments that pin a regression or explain a non-obvious assertion stay.
  • tests/helpers/setup.bash: follows the full bash rules ([[ ]], (( )), printf). @test bodies keep bats' [ ] idiom.
  • Flake fix (8e59bff): in tests/install.bats, the stub3/docker stub now drains stdin on login.
    • Cause: the stub never read stdin, so the printf feeding docker login --password-stdin in common/install.sh could die of SIGPIPE under pipefail.
    • Effect: "start_stack logs in to ghcr only when a token is set" failed intermittently.

No test names, assertions or fixture bytes changed.

How it was verified

  • mise run lint exits 0.
  • mise run test-runner passes 265/265.
  • The flaky test failed repeatedly in 60 runs before the fix and passed 70/70 runs after it.

Checklist

  • mise run lint passes
  • mise run test-runner passes
  • New behaviour has a test that fails without the change
  • Docs that describe changed behaviour were updated in the same commit
  • No unrelated changes

iam-truongtrungnghia added 2 commits September 16, 2026 22:27
Tighten tests/*.bats and tests/helpers/setup.bash comments to a single
WHY point each, dropping step narration, dates and incident counts while
keeping the regression each assertion pins. Brings setup.bash's helper
functions into the full [[ ]]/local/printf rule set. No test name or
assertion changed.
stub3/docker never reads stdin, so printf token | docker login
--password-stdin can die of SIGPIPE under pipefail, failing "start_stack
logs in to ghcr only when a token is set" at random. Draining stdin on
login keeps the stub's logging intact while removing the race.
@ttncode
ttncode merged commit f52b586 into main Sep 16, 2026
21 checks passed
@ttncode
ttncode deleted the refactor/tests-shell branch September 16, 2026 16:27
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