zynagent-first application framework

Test command#

Usage:
  zyn test [--filter TEXT|--exact NAME] [--timings] [-j N|--jobs N]
  zyn test --list [--filter TEXT|--exact NAME]

Run isolated application tests. Use check to also verify formatting, artifacts, and compilation.

Example:
  zyn test --list

Documentation: zyn docs cli/test

Without a selector, the command runs every Zig test reachable from src/app.zig, including tests in imported application files. --filter selects displayed test names containing a case-sensitive substring. --exact selects displayed names equal to its argument. --list prints matching names in source order without executing tests; it cannot be combined with --timings or a jobs option. A selector matching no tests exits with status one and directs the caller to zyn test --list.

Selected tests execute in isolated child processes with automatic bounded concurrency. -j N or --jobs N overrides the maximum number of tests running at once; N must be between one and sixteen, and --jobs 1 selects serial execution. Each test reports PASS, SKIP, or FAIL, followed by totals and the total suite execution time. Captured standard output and standard error stay hidden for passing and skipped tests, but are shown for failures and crashed test processes:

PASS  actions.create validates a name
SKIP  mailer sends a receipt

1 passed, 1 skipped, 0 failed in 42.125 ms

--timings adds a per-test report after the totals. Each duration is measured with a monotonic clock from child launch until child completion, and the report lists every pass, skip, failure, and crash from slowest to fastest. The flag can be combined with either jobs form in any order.

Returned failures include the error name and Zig error return trace. Panics and early exits retain their native diagnostics, and the remaining tests still run.

The command uses the application's normal module graph and the encrypted test credential profile, without environment overrides. Output uses color when supported and respects NO_COLOR and CLICOLOR_FORCE.

A generated application with no tests reports the zero-test result after source inspection without starting Zig. Applications using the generated build file may reuse a cached test executable while their source, framework, generated metadata, compiler environment, and executable contents remain unchanged. Customized build files always run their declared zyn-test step. Test selection is applied by the runner and does not invalidate an otherwise reusable test executable.

See framework/testing for test organization and managed database and HTTP examples.