test: BATS coverage for dream-cli robustness (compose wrapper + set -u/pipefail guards)
Consolidated from: #406 + #410
Scope
Add BATS coverage that pins:
Coverage matrix
#406 — compose wrapper:
- Success path: compose exits 0 → " — done" message, temp log removed, function returns 0.
- Failure path with matching keywords: error banner emitted, relevant lines extracted, log path printed, function returns compose exit code.
- Failure path with zero grep matches:
|| warn "..." fires, log path still printed, function returns compose exit code (not grep's 1).
- Caller usage (
dream restart/stop/start) propagates the wrapper's exit correctly.
#410 — set -u + pipefail guards:
- Top of
dream-cli has set -euo pipefail.
- Running dream-cli with minimal env (
env -i HOME=/tmp PATH=/usr/bin:/bin) doesn't crash on unbound variables.
- All conditional vars accessed via
${FOO:-default} form (static grep assertion).
sed -n '1p' replacements for | head -1 still in place (BSD SIGPIPE-safe).
Files
- New:
dream-server/tests/bats-tests/test-compose-summary-wrapper.bats
- New:
dream-server/tests/bats-tests/test-dream-cli-flags.bats
Rationale for merge
#410's body explicitly states "naturally bundles with #406." Both are BATS, both target dream-cli internals, small combined PR. If either test regresses in CI both indicate distinct concerns (compose wrapper robustness vs. shell flag hygiene) — no hidden failures.
Discovery context
Filed during 23APR audit/fix cycle. PR-7 added pipefail; PR-11 enabled set -u + nounset guards; PR-10 introduced the compose summary wrapper (and round-2 fixup replaced || true with || warn). All live in 23APRdevelopments.
Closes #406, #410. Labels: test, bash
test: BATS coverage for dream-cli robustness (compose wrapper + set -u/pipefail guards)
Consolidated from: #406 + #410
Scope
Add BATS coverage that pins:
_compose_run_with_summarysuccess/error paths + log-path surfacing + exit-code propagation (test: BATS/pytest coverage for dream restart/start/stop/update compose wrapper #406).set -euo pipefailat dream-cli:6 AND the nounset guards applied by PR-11 (test: lock in set -u + pipefail flags and nounset guards in dream-cli #410).Coverage matrix
#406 — compose wrapper:
|| warn "..."fires, log path still printed, function returns compose exit code (not grep's 1).dream restart/stop/start) propagates the wrapper's exit correctly.#410 — set -u + pipefail guards:
dream-clihasset -euo pipefail.env -i HOME=/tmp PATH=/usr/bin:/bin) doesn't crash on unbound variables.${FOO:-default}form (static grep assertion).sed -n '1p'replacements for| head -1still in place (BSD SIGPIPE-safe).Files
dream-server/tests/bats-tests/test-compose-summary-wrapper.batsdream-server/tests/bats-tests/test-dream-cli-flags.batsRationale for merge
#410's body explicitly states "naturally bundles with #406." Both are BATS, both target dream-cli internals, small combined PR. If either test regresses in CI both indicate distinct concerns (compose wrapper robustness vs. shell flag hygiene) — no hidden failures.
Discovery context
Filed during 23APR audit/fix cycle. PR-7 added pipefail; PR-11 enabled set -u + nounset guards; PR-10 introduced the compose summary wrapper (and round-2 fixup replaced
|| truewith|| warn). All live in23APRdevelopments.Closes #406, #410. Labels: test, bash