mirror of
https://github.com/openai/codex.git
synced 2026-09-17 12:23:33 +00:00
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:
37
.github/workflows/rust-ci.yml
vendored
37
.github/workflows/rust-ci.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user