Annotate nextest failures in CI

Capture nextest output in rust-ci and emit parsed FAIL/LEAK lines as annotations and step-summary text when tests fail.

Also record the isolated Linux test failure on b6e18d2e8 in the flaky-test ledger.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Ahmed Ibrahim
2026-03-14 07:40:42 +00:00
parent b6e18d2e8c
commit 7613630080
2 changed files with 37 additions and 1 deletions

View File

@@ -598,7 +598,42 @@ jobs:
- name: tests
id: test
run: cargo nextest run --all-features --no-fail-fast --target ${{ matrix.target }} --cargo-profile ci-test --timings
shell: bash
run: |
set -euo pipefail
log_file="$(mktemp)"
trap 'rm -f "$log_file"' EXIT
set +e
cargo nextest run --all-features --no-fail-fast --target ${{ matrix.target }} --cargo-profile ci-test --timings 2>&1 | tee "$log_file"
status=${PIPESTATUS[0]}
set -e
if [[ $status -ne 0 ]]; then
summary_lines="$(grep -E '^(FAIL|LEAK)([[:space:]]|$)' "$log_file" || true)"
if [[ -n "$summary_lines" ]]; then
{
echo "### nextest failure summary"
echo '```text'
printf '%s\n' "$summary_lines"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
while IFS= read -r line; do
echo "::error::$line"
done <<< "$summary_lines"
else
{
echo "### nextest failure tail"
echo '```text'
tail -n 200 "$log_file"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
echo "::error::nextest failed without a parsable FAIL/LEAK line; inspect the tail in the step summary"
fi
fi
exit $status
env:
RUST_BACKTRACE: 1
NEXTEST_STATUS_LEVEL: leak