End-to-end tests
clix's e2e suite is e2e_test.go in this directory: a
black-box suite that builds exampletool/ — a
consumer program wired the way README.md's Use program
and docs/specs/consumer-api.md prescribe
(ldflags-injected build metadata, App.Run on a cobra root, NewReporter for
progress, OutputJSON/OutputJSONError for data) — and runs it as a
subprocess. It asserts what only a finished binary shows: fang's --version
output carrying the injected metadata, the stdout/stderr split (data on
stdout, text progress on stderr), the Silent > JSON > Text priority, the JSON
error envelope, and process exit codes. The unit tests next to each source
file (clix_test.go, flags_test.go, output_test.go, reporter_test.go)
cover the same behavior in-process. TestMain exits early when no go
toolchain is on PATH.
Run it with:
go test -v ./tests/e2e/... # the e2e suite alone
make test # everything, e2e included
CI runs it inside the Unit Tests and Race Detection jobs of
.github/workflows/ci.yml, which run
different commands. Unit Tests runs the repository gate make ci, whose
test step is the coverage-instrumented
go test -v -coverprofile=coverage.out -covermode=atomic -coverpkg=github.com/frostyard/clix ./...
defined by the test target; Race Detection runs
go test -race ./... directly. Both invocations end in ./..., so both
include this package. This README is the discoverable e2e entry point named
by ADR-0001.