Skip to content

CLI: visualci test -- <command> (sc-8795) - #21

Merged
ndbroadbent merged 1 commit into
mainfrom
cli-test
Dec 2, 2026
Merged

ndbroadbent merged 1 commit into
mainfrom
cli-test

Conversation

@ndbroadbent

Copy link
Copy Markdown
Member

sc-8795, first part. Test runners that start many processes per run (cargo test runs each tests/*.rs as its own binary, nextest one per test, pytest-xdist and Jest workers) have nowhere to create one build and finalize it at the end. Without VISUALCI_BUILD_ID a helper creates a build per process, and a build nobody finalizes expires as failed after an hour.

visualci test -- <command>:

  • creates the build;
  • runs the command with VISUALCI_BUILD_ID set, plus --token, --project and --api-url when given, so every test, process or worker adds to that one build;
  • finalizes the build when the command ends, even if the tests fail, send nothing or are interrupted;
  • waits for the result and prints what changed, like visualci check.

Details:

  • Local runs are a subset, so a filtered run (cargo test foo) reports nothing as removed.
  • --upload also sends visualci.yml's uploads after the command, for runners that write snapshot files (visualci test --upload -- npx jest -u).
  • Ctrl-C still stops the tests, and this process stays to finalize. It ignores SIGINT and SIGQUIT only after starting the command, because an ignored signal would carry over into the tests.
  • Exit code: the command's own when it failed (the build is still finalized and printed). Otherwise 0 when CI should pass, 1 when it shouldn't, 3 when the result didn't come in time, and 4 when out of credits. --no-wait finalizes and exits with the command's status.

Tests:

  • exit-code precedence;
  • the command sees the build ID and project;
  • an interrupted command returns 130 while the CLI survives.

End to end against the dev server: a run whose command sent one snapshot and exited 3 → build finalized ("added cli/a.txt"), exit 3. A passing run that sent nothing → finalized as unchanged, exit 0.

CLI 0.2.10 (libc on Unix for the signals). #20 (snapshot-diff) also bumps to 0.2.10, so whichever merges second moves on. The docs (local runs page and each snapshot guide) follow in the pin commit once the release is out. The quiet expiry of unfinalized local builds is sc-8795's second part.

Review: no screenshots change.

…s the tests with VISUALCI_BUILD_ID set, and finalizes it when they end (failed, empty or interrupted too: Ctrl-C stops the tests, not the finalize), waits and prints the result; local runs are subsets; --upload sends visualci.yml's uploads after; the command's failure is the exit code
@visualci-com

visualci-com Bot commented Dec 2, 2026

Copy link
Copy Markdown

VisualCI

docspring/visualci · build #111 · 293 unchanged · no changes

This PR vs base: nothing since #108, across 1 build

Updated as builds change. Agents can review with VisualCI's MCP tools.

@ndbroadbent
ndbroadbent merged commit 94991c0 into main Dec 2, 2026
10 checks passed
@ndbroadbent
ndbroadbent deleted the cli-test branch December 2, 2026 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant