Skip to content

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

ci(scripts): log scratch disk usage after each coverage suite

Steven Enamakeld18b6b3e1e6f
diff --git a/scripts/ci/rust-coverage.sh b/scripts/ci/rust-coverage.sh
index 7b6ede0f32..e9657d4dfd 100755
--- a/scripts/ci/rust-coverage.sh
+++ b/scripts/ci/rust-coverage.sh
@@ -165,10 +165,23 @@ target_expected_in_coverage() {
# merged from whatever did run. A cancellation (130/143 from
# scripts/ci-cancel-aware.sh) stops the run at once.
FAILED_SUITES=()
+
+# On the self-hosted guest (CI_SCRATCH_DIR is set) log what the scratch disk has
+# left and how large the coverage target and its raw profiles are after each
+# suite, so a full disk (EX63 run 39292268284) names the suite that grew it.
+disk_note() {
+ [ -n "${CI_SCRATCH_DIR:-}" ] || return 0
+ local target="${CARGO_BUILD_TARGET_DIR:-target}" free
+ free="$(df -h "${CI_SCRATCH_DIR}" 2>/dev/null | awk 'NR==2 { print $4 " free of " $2 }')"
+ log "disk after $1: ${free:-unknown}; target $(du -sh "${target}" 2>/dev/null | cut -f1)," \
+ "profraw $(find "${target}" -name '*.profraw' -print0 2>/dev/null | du -ch --files0-from=- 2>/dev/null | tail -1 | cut -f1)"
+}
+
suite() {
local name="$1" rc=0
shift
COV_SUITE="$(printf '%s' "$name" | tr -cs '[:alnum:]' '-')" "$@" || rc=$?
+ disk_note "${name}"
case "${rc}" in
0) ;;
130 | 143)