Skip to content

[test] end-to-end golden suite: build binary, run samples, assert stdout/exit (STAR-53)#20

Merged
vt128 merged 1 commit into
masterfrom
test/e2e-golden-suite
Jun 22, 2026
Merged

[test] end-to-end golden suite: build binary, run samples, assert stdout/exit (STAR-53)#20
vt128 merged 1 commit into
masterfrom
test/e2e-golden-suite

Conversation

@vt128

@vt128 vt128 commented Jun 22, 2026

Copy link
Copy Markdown
Member

What

The v0.1.0 cost-price audit's flagship P0 gap: no test built the real binary and ran scripts through it, so the wired modules were only load-verified, never proven to work. Add an e2e package whose TestMain builds the starcli binary and runs sample scripts via exec.Command, asserting stdout and the exit code.

Cases (through the real CLI)

  • print / basic output
  • the newly-wired pure domain modules actually produce results: emoji (emojize → a glyph 👋), yaml (decode), qrcode (encode().size)
  • fail() aborts non-zero with the message on stderr
  • cmd execution gating: disabled by default (run() → non-zero + "disabled"); --allow-cmd actually runs a command (run("go version").successTrue)
  • --caps safe withholds http (non-zero + "withheld")
  • --check validates without running (valid → 0 and the script's print never fires; invalid syntax → non-zero)

Verification

  • Full -race green; Docker golang:1.25 (go floor) builds + runs the binary in-container and passes.

Tracks STAR-53 P0 ② (the "最值钱" gap). Next: P0 ③ domain-module real integration (sqlite local / markdown render / gum static).

…out/exit (STAR-53)

The v0.1.0 cost-price audit's flagship P0 gap: no test built the real binary and
ran scripts through it, so the wired modules were only "load-verified", never
proven to work. Add an e2e package whose TestMain builds the starcli binary and
runs sample scripts via exec.Command, asserting stdout and the exit code.

Cases (through the real CLI):
- print / basic output
- the newly-wired pure domain modules actually produce results: emoji
  (emojize -> a glyph), yaml (decode), qrcode (encode().size)
- fail() aborts non-zero with the message on stderr
- cmd is disabled by default (run() -> non-zero + "disabled"); --allow-cmd
  actually runs a command (run("go version").success -> True)
- --caps safe withholds http (non-zero + "withheld")
- --check validates without running (valid -> 0 and the script's print never
  fires; invalid syntax -> non-zero)

Full -race green; Docker golang:1.25 floor builds + runs the binary in-container.
@vt128 vt128 merged commit 029353e into master Jun 22, 2026
6 checks passed
@vt128 vt128 deleted the test/e2e-golden-suite branch June 22, 2026 06:06
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