Skip to content

refactor(tests): shared binary build + runVideoCmd consolidation (0.6.1)#7

Merged
voidkey merged 1 commit into
mainfrom
refactor/test-infra-polish
May 15, 2026
Merged

refactor(tests): shared binary build + runVideoCmd consolidation (0.6.1)#7
voidkey merged 1 commit into
mainfrom
refactor/test-infra-polish

Conversation

@voidkey
Copy link
Copy Markdown
Collaborator

@voidkey voidkey commented May 14, 2026

Summary

A 0.6.1 patch consolidating three integration-test infra fixes that prior reviewers flagged but kept getting deferred. Internal refactor; no behavior change for users.

Changes

  1. Shared binary build (tests/integration/cli_smoke_test.go). build(t) now caches the compiled vibeknow via sync.Once + a package TestMain that cleans up the temp dir on exit. 15+ callers share a single go build per go test run instead of each rebuilding. Cold-cache CI gets a meaningful speedup; hot-cache developer runs see modest fork-overhead reduction.

  2. runVideoCmd signature change from (stdout, combined, exitCode) to (stdout, stderr, exitCode). Callsites that want a combined view do stdout + stderr themselves. The 3 existing callers in video_flow_test.go plus 4 hand-rolled exec.Command(bin, ...) blocks (create_credits_test, create_engine_test, create_mode_test, kb_prune_test) migrated to this single helper. Net: ~80 lines of duplicated env-setup + ExitError-unwrap boilerplate gone.

  3. .gitignore covers *.pdf / *.docx so local smoke-test files (the *.docx / *.pdf artifacts I dropped into the repo root during real-backend smoke) don't appear as untracked commit candidates. The pre-existing test.pdf ignore is subsumed by the broader catch-all.

Test plan

  • go test ./... green (all integration tests pass with the new helper signature)
  • go build ./... clean
  • git status after the change shows only docs/ untracked (no *.docx / *.pdf files surfacing)
  • CI three-platform should remain green (will appear after push)

What's NOT in this PR

  • Locale pinning (VIBEKNOW_LANG=en) across integration tests — would require a broader test-environment audit; separate concern.
  • runVideoCmd rename to runCLI — the name is misleading now that non-video tests use it, but the rename is mechanical churn separate from this consolidation.
  • Bigger cleanup of integration-test patterns (e.g., shared mock-vectoria handlers) — would require designing a test-helper API, separate spec.

Commits

  • 2fd1392 refactor(tests): shared binary build + runVideoCmd consolidation (0.6.1)

Three pieces of integration-test infra hygiene that /simplify
reviewers flagged across the 0.4.x / 0.5.x / 0.6.0 PRs but kept
getting deferred. Bundled into a focused patch release.

1. Shared binary build via sync.Once + TestMain (tests/integration/
   cli_smoke_test.go). 15+ callers of build(t) now share a single
   compile per `go test` run instead of each rebuilding.

2. runVideoCmd signature changed from (stdout, combined, exitCode)
   to (stdout, stderr, exitCode). Callers that want the combined
   string compute `stdout + stderr` explicitly. The 3 existing
   callers in video_flow_test.go and the 4 hand-rollers
   (create_credits, create_engine, create_mode, kb_prune) all
   migrated to use this single helper. Removes ~80 lines of
   duplicated exec.Command / env / ExitError boilerplate.

3. .gitignore covers *.pdf and *.docx so local smoke-test files
   (real-backend manual testing) don't sit as untracked
   commit-bait. test.pdf was already ignored; broader catch-all
   subsumes it.

No behavior change for end users. Internal test refactor.
@voidkey voidkey merged commit 4e7017c into main May 15, 2026
3 checks passed
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