Skip to content

feat(ci): run all local test suites with visible skips - #48

Merged
allisonmahmood merged 2 commits into
mainfrom
feat/issue-34-test-all
Aug 27, 2026
Merged

allisonmahmood merged 2 commits into
mainfrom
feat/issue-34-test-all

Conversation

@allisonmahmood

Copy link
Copy Markdown
Owner

Running the complete local test surface required knowing several separate commands, and skipped CI-only checks were invisible.

This adds pnpm test:all, which runs the workspace and local root suites, continues after failures, and reports explicit skips plus a final failure count. The server-image verifier remains CI-only and is shown as skipped with its reason.

Closes #34

Verification:

  • pnpm test:all
  • pnpm typecheck
  • pnpm lint

Implemented with openai-codex/gpt-5.6-sol using the Oh My Pi coding harness.

@github-actions github-actions Bot added area:ci CI, shared testing infrastructure, development scripts and tooling size:s Under 100 changed lines labels Aug 27, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Code review (PR 48 vs issue #34)

Eight independent read-only reviewers: Standards, Spec, issue-34 intent, implementation method, YAGNI, POSIX shell, test-surface completeness, and module design. Standards and Spec are kept on separate axes on purpose — a pass on one does not excuse a miss on the other.

Diff: git diff origin/main...HEAD (d43aaaf feat(ci): add local test-all runner). Spec source: issue #34.


Standards

No hard documented-standard breach. AGENTS.md / CLAUDE.md (pin versions, review notes stay in PRs) are untouched. Prettier/eslint do not apply to the shell script.

Documented conventions (judgement, not hard)

package.json — test:all
Root scripts are turbo run …, node scripts/…, or bash scripts/… (test:server-image). This adds "test:all": "sh scripts/test-all.sh". Same tree: scripts/verify-server-image.sh is #!/usr/bin/env bash. POSIX sh is a reasonable choice for a continue-on-fail runner, but it is a new interpreter path.

README.md — “Other commands: pnpm test, pnpm typecheck, pnpm build.” New root command is not listed. docs/DEVELOPMENT.md also has no test-all note. Docs are a listed source, not a “must update” rule.

turbo.json — test
lint / typecheck use dependsOn: ["^build"]. New test is only cache: false (same cache style as dev / db:migrate / docker). Matches a vitest-from-source layout; it does not match the lint/typecheck pipeline. pnpm test remains root vitest run, while the runner calls turbo run test — two entry points, neither named in the turbo convention until this PR.

Baseline smells (all judgement)

Speculative Generality — scripts/test-all.sh
skip_suite exists for one always-skip:

skip_suite() {
  suites=$((suites + 1))
  printf '\nSKIP %s: %s\n' "$1" "$2"
}
…
skip_suite "test:server-image" "CI-only server image build"

No caller ever unskips. A printf would do. Counting the skip in suites also makes "%s of %s suites failed" include a suite that never ran (Mysterious Name on the total).

Mysterious Name — dual test
"test" = vitest run; "test:all" = turbo + extra scripts. Fine if you know CI, easy to treat as “the full vitest run.”

No Duplicated Code, Feature Envy, Data Clumps, Primitive Obsession, Repeated Switches, Shotgun Surgery, Divergent Change, Message Chains, Middle Man, or Refused Bequest worth calling. The three-file spread is one runner, not shotgun. Continue-without-set -e is intentional vs verify-server-image.sh’s set -euo pipefail.


Spec

(a) Missing or partial

Runtime skip reasons. Spec: “Every entry either runs or prints a visible skip with the reason (Docker unreachable, macOS-only, no Postgres).” Done-when: “names what it skipped and why.” The only skip is hardcoded test:server-image / "CI-only server image build". There is no probe for Docker, OS, or Postgres. turbo run test, test:packed-cli-e2e, and test:docker-save always run; a missing Postgres (or failed embedded-Postgres) is a FAIL, not a named skip. The skip examples from the issue are not implemented.

“Five test:* root scripts.” Spec: “knowing the five test:* root scripts plus turbo run test” and “runs turbo run test --continue and each test:* root script.” Root package.json has three test:* scripts (packed-cli-e2e, docker-save, server-image). The runner covers those three plus turbo. The extra two do not exist; this is a spec overcount, not an omitted script.

Root "test": "vitest run" (what CI’s test job runs) is not test:* and is not invoked. Coverage of package tests is via turbo run test instead, which the Do list asked for.

(b) Not asked for (scope)

turbo.json test task with "cache": false. Spec never mentions turbo.json or cache policy. turbo run test is required; disabling cache is extra pipeline behavior.

(c) Looks implemented, but wrong vs spec

Skip counting in the summary. Spec: “ends with N of M suites failed.” skip_suite still does suites=$((suites + 1)), so a skipped CI job is in M (0 of 4 suites failed). It never ran; treating it as a suite in the fail tally overstates M.

Platform-specific stay-out is only the image verifier. Spec: “CI-only jobs (the server image build, anything platform-specific) stay out.” test:server-image is correctly not executed. CI still has extra packed-CLI probe modes (--platform-probes, --lifecycle-probes, --signal-probes) that test:all does not name as skipped entries. Those are not root test:* scripts, so omission is defensible; they are not visible skips either.

Otherwise on-spec: POSIX scripts/test-all.sh, pnpm test:all, continue-on-failure, CI image job not run, no new test suites, non-zero exit when failures > 0.


Intent vs issue 34

#34’s problem is tribal knowledge: there is no single local command, and skipped work is invisible. The quoted north star is do not run CI-only / platform-only tests on a machine that gets no benefit from them — and say so. Visible skip-with-reason is the product.

The PR solves the “one command, keep going, N of M, no new suites” checklist. It only partly solves the skip contract. The only skip is a hardcoded SKIP test:server-image: CI-only server image build. If a suite cannot run on this host, you get a FAIL (or a crash inside the suite), not a named skip.

That said, the parentheticals in the issue (Docker unreachable, macOS-only, no Postgres) do not currently map onto these suites:

  • test:docker-save is a synthetic-tar unit test. It does not need a Docker daemon.
  • test:packed-cli-e2e is POSIX (Linux + macOS), not mac-only. Win32 is rejected inside the harness; CI’s --platform-probes / --lifecycle-probes / --signal-probes are extra cli-smoke jobs, not root test:* scripts.
  • Workspace Vitest uses embedded-postgres. Failure is a red suite, not a skip-worthy missing service.

So the letter of “every entry runs or prints SKIP + reason” is met for the one suite that must stay out. Inventing Docker/macOS/Postgres probes for suites that do not have those gates would be implementing the examples instead of the actual surface. The spirit gap is narrower than a first reading of the issue: CI probe jobs are omitted with no SKIP line, and the skip helper is a checkbox rather than an observation about the host.

turbo.json test.cache=false is extra relative to the issue.

Done when, on a clean Linux checkout: the command will run what this script always runs, name the one hardcoded skip, and exit non-zero if a run_suite fails. Packed-cli-e2e builds server + CLI itself; CLI unit tests beforeAll the CLI bundle. It should not fail solely for missing dist/.


Method

A tiny root orchestrator is the right seam. Packed-cli-e2e and docker-save are not workspace packages; stuffing them into turbo would be a fake package/task. One command at pnpm test:all is the locality.

What works:

  • run_suite + if "$@" is the real depth: continue-on-failure across heterogeneous commands. set -e would be the wrong shape. POSIX is correct here; matching verify-server-image.sh’s bash would be cargo-cult.
  • Hardcoding the suite list (instead of globbing test:*) is the YAGNI win. Discovery would execute test:server-image without an image and fight the CI split.
  • No extra dep (npm-run-all, concurrently). Nested pnpm run is ugly, not wrong.

What is weaker:

  • skip_suite fails the deletion test. It never decides anything. It prints SKIP, bumps suites, and makes 0 of 4 suites failed count a suite that never ran. Hardcoded omit is the policy; a skip framework is not.
  • turbo run test is not what CI’s test job runs. CI is pnpm test (one root Vitest, **/src/**/*.test.ts, one embedded-Postgres setup). Turbo runs six package Vitests, no //#test, two Postgres setups in parallel. Same files, different topology. The issue asked for turbo explicitly, so this is on-spec and still a fork of the local/CI unit-test interface.
  • test.cache=false in turbo.json is a graph-wide side effect of that fork. Independently reasonable if turbo is the test interface — tests must not hash green and skip. Putting --force only on this invocation would keep the change local; putting it in turbo.json is the honest policy if anyone else runs turbo run test.

Inlining && in package.json is simpler only if you drop continue-on-failure labels. A Node orchestrator is heavier for no leverage.

Keep the sh wrapper. Collapse skip_suite to a printf (or leave the comment and do not count it in M). Do not add capability detection until a suite actually has a host gate.

POSIX notes, not blockers: Ctrl-C on a child typically becomes exit 130 and is treated as FAIL, then the rest still run — interrupt ≠ test failure. Bare turbo depends on pnpm putting node_modules/.bin on PATH; ./scripts/test-all.sh directly usually cannot find it. pnpm exec turbo would be the safer lookup.


YAGNI / beauty

Simplicity score: 7/10 (the script is close; skip_suite is the bloat).

run_suite earns its keep. Unrolling three copies of the if/status dance would be worse. skip_suite does not: one hardcoded call plus a skip API. The comment above that call already explains why the image verifier stays out.

Counting SKIP in the denominator is a small lie. Either omit it from suites, or print failed/ran and do not invent a fourth suite.

Aligned RUN / PASS / FAIL / SKIP verbs are cheap. Dual shebang + sh scripts/test-all.sh is noise but means the file need not be executable. Keep the hardcoded list.

The one change that would make this more beautiful: delete skip_suite. Don’t increment suites for a no-op. Leave the comment. Ship the rest. Do not add a skip matrix for Docker/macOS/Postgres that nothing in this runner can actually trip.


Standards: 0 hard violations, 3 judgement findings. Worst in-axis: skip_suite as Speculative Generality, with skipped suites counted in M.

Spec: 4 findings (2 missing/partial, 1 scope, 1 wrong-vs-spec). Worst in-axis: skip-with-reason is a hardcoded CI-only line, not host-aware skips — with the caveat that the issue’s example reasons do not currently apply to these suites.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Review triage

I checked the findings against the current test surface.

I will address

  • Discoverability: add pnpm test:all to the README command list and explain that unsupported/CI-only suites are reported as skips. The issue exists to remove tribal knowledge, so the command should be documented.
  • Single-use skip abstraction: inline the one SKIP report instead of keeping skip_suite. run_suite earns its abstraction because it owns continue-on-failure behavior; the one-off skip helper does not.

I will not change

  • Docker/macOS/Postgres probes: none maps to a current local suite. test:docker-save uses synthetic archives and needs no daemon, packed CLI E2E supports Linux/macOS, and workspace tests use embedded Postgres. Adding these probes would turn real failures into incorrect skips.
  • CI packed-CLI probe entries: they are not root test:* scripts and are intentionally CI-only/platform-specific, so keeping them out matches the issue.
  • Skipped suite in the denominator: M is the number of known suite entries, not only executed entries. The adjacent SKIP line makes the state explicit, so 0 of 4 suites failed is accurate.
  • test.cache=false: turbo run test is required by the issue, and disabling cache ensures test:all actually executes the local suites rather than replaying a cached green result.
  • turbo run test, POSIX sh, and the dual test/test:all names: these follow the issue's explicit interface. Direct execution of the shell file and alternative interrupt handling are outside the supported pnpm test:all seam.

After the two accepted changes I’ll rerun pnpm test:all, typecheck, and lint, then push the update.

@github-actions github-actions Bot added the area:docs Touches the docs area label Aug 27, 2026
@allisonmahmood
allisonmahmood merged commit 8c09545 into main Aug 27, 2026
7 checks passed
@allisonmahmood
allisonmahmood deleted the feat/issue-34-test-all branch August 27, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, shared testing infrastructure, development scripts and tooling area:docs Touches the docs area size:s Under 100 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(ci): local test:all runner with visible skips

1 participant