Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(ci): run all coverage suites and report failures together

Steven Enamakel6ceba5a43d49
diff --git a/scripts/ci/rust-coverage.sh b/scripts/ci/rust-coverage.sh
index e5e7cde5a5..1b25a31c4a 100755
--- a/scripts/ci/rust-coverage.sh
+++ b/scripts/ci/rust-coverage.sh
@@ -80,6 +80,29 @@ target_features_satisfied() {
done
}
+# Every suite runs even when an earlier one fails, so one red crate never
+# hides the results of the crates and targets after it. Failures are
+# collected and reported together at the end, after the lcov report is still
+# merged from whatever did run. A cancellation (130/143 from
+# scripts/ci-cancel-aware.sh) stops the run at once.
+FAILED_SUITES=()
+suite() {
+ local name="$1" rc=0
+ shift
+ "$@" || rc=$?
+ case "${rc}" in
+ 0) ;;
+ 130 | 143)
+ log "cancelled during ${name} (exit ${rc})"
+ exit "${rc}"
+ ;;
+ *)
+ FAILED_SUITES+=("${name} (exit ${rc})")
+ log "FAILED: ${name} (exit ${rc}); continuing with the remaining suites"
+ ;;
+ esac
+}
+
run_integration_target() {
local target="$1"
if ! target_features_satisfied "${target}"; then
@@ -93,15 +116,15 @@ run_integration_target() {
while IFS= read -r module; do
[ -n "${module}" ] || continue
log "running raw coverage module: ${module}"
- llvm_cov --no-report --no-fail-fast -p openhuman-cli \
- --test "${target}" -- "${module}::" --test-threads=1 || return
+ suite "${target}::${module}" llvm_cov --no-report --no-fail-fast -p openhuman-cli \
+ --test "${target}" -- "${module}::" --test-threads=1
done < <(raw_coverage_modules)
elif [ "${target}" = "json_rpc_e2e" ]; then
# JSON-RPC tests share runtime/config globals and must remain serial.
- llvm_cov --no-report --no-fail-fast -p openhuman-cli \
+ suite "${target}" llvm_cov --no-report --no-fail-fast -p openhuman-cli \
--test "${target}" -- --test-threads=1
else
- llvm_cov --no-report --no-fail-fast -p openhuman-cli --test "${target}"
+ suite "${target}" llvm_cov --no-report --no-fail-fast -p openhuman-cli --test "${target}"
fi
}
@@ -111,22 +134,22 @@ llvm_cov clean --workspace
# Keep the aggregate unit-test process aligned with the canonical Rust runner.
# The isolated reaper test installs one-shot process globals, so it cannot run
# in the same process as the rest of the library tests.
-llvm_cov --no-report --no-fail-fast -p openhuman --lib --bins -- \
+suite "openhuman lib+bins" llvm_cov --no-report --no-fail-fast -p openhuman --lib --bins -- \
--test-threads=1 \
--skip a_build_only_runtime_is_swept_before_it_can_be_invoked
log "running isolated build-only reaper test"
-llvm_cov --no-report --no-fail-fast -p openhuman --lib -- \
+suite "openhuman reaper (isolated)" llvm_cov --no-report --no-fail-fast -p openhuman --lib -- \
openhuman::agent::tinyagents::reaper::tests::a_build_only_runtime_is_swept_before_it_can_be_invoked \
--exact --test-threads=1
# Run every root-workspace Rust support crate rather than only crates named by
# changed paths. Product features are forwarded to the embedding facade; the
# remaining crates do not expose that feature vocabulary.
-llvm_cov_embed --no-report --no-fail-fast -p openhuman-embed --all-targets
-llvm_cov_package --no-report --no-fail-fast -p openhuman-rpc --all-targets
-llvm_cov_embed --no-report --no-fail-fast -p openhuman-tinyhumans --all-targets
-llvm_cov_package --no-report --no-fail-fast -p openhuman-tui --all-targets
+suite "openhuman-embed" llvm_cov_embed --no-report --no-fail-fast -p openhuman-embed --all-targets
+suite "openhuman-rpc" llvm_cov_package --no-report --no-fail-fast -p openhuman-rpc --all-targets
+suite "openhuman-tinyhumans" llvm_cov_embed --no-report --no-fail-fast -p openhuman-tinyhumans --all-targets
+suite "openhuman-tui" llvm_cov_package --no-report --no-fail-fast -p openhuman-tui --all-targets
while IFS= read -r target; do
[ -n "${target}" ] || continue
@@ -136,11 +159,18 @@ done < <(integration_test_targets)
# Doctests are not collected by cargo-llvm-cov, but they are still part of the
# complete Rust test suite and must run whenever the Rust-core area changes.
-bash scripts/ci-cancel-aware.sh cargo test -p openhuman \
+suite "openhuman doctests" bash scripts/ci-cancel-aware.sh cargo test -p openhuman \
--doc --features "${PRODUCT_FEATURES}"
log "merging coverage into ${OUT}"
-llvm_cov report --lcov --output-path "${OUT}"
+suite "lcov report" llvm_cov report --lcov --output-path "${OUT}"
# A full product build must produce records for every eligible source file.
-bash scripts/ci/assert-coverage-presence.sh "${OUT}" --all
+suite "coverage presence" bash scripts/ci/assert-coverage-presence.sh "${OUT}" --all
+
+if [ "${#FAILED_SUITES[@]}" -gt 0 ]; then
+ log "${#FAILED_SUITES[@]} suite(s) failed:"
+ printf '[ci][rust-cov] - %s\n' "${FAILED_SUITES[@]}"
+ exit 1
+fi
+log "all suites passed"